nix/nixos/common.nix

202 lines
3.4 KiB
Nix
Raw Normal View History

2023-09-22 12:56:48 -05:00
{ config, lib, inputs, system, ... }:
let
2023-10-02 16:06:56 -05:00
pkgs = inputs.nixpkgs.legacyPackages.${system};
2023-09-22 12:56:48 -05:00
in
{
2023-09-06 01:20:43 -05:00
services.journald.extraConfig = "SystemMaxUse=1G";
2023-09-05 23:11:14 -05:00
environment = {
variables = {
EDITOR = "hx";
VISUAL = "hx";
PAGER = "less";
MANPAGER = "less";
};
systemPackages = with pkgs; [
age
bat
bind
bottom
2023-09-06 00:57:08 -05:00
btrfs-progs
cue
2023-09-05 23:11:14 -05:00
curl
dog
dua
2023-09-29 16:57:26 -05:00
eza
2023-09-05 23:11:14 -05:00
fd
file
gnumake
2023-09-05 23:51:32 -05:00
gron
2023-10-02 16:06:56 -05:00
helix
2023-09-05 23:11:14 -05:00
hexyl
htop
iputils
2023-09-05 23:51:32 -05:00
jq
2023-09-05 23:11:14 -05:00
killall
less
mosh
nmap
openssl
pciutils
2023-09-06 00:57:08 -05:00
pv
2023-09-05 23:11:14 -05:00
rclone
restic
ripgrep
rsync
2023-10-02 16:02:01 -05:00
rtx
2023-09-05 23:11:14 -05:00
sd
sops
2023-09-05 23:51:32 -05:00
smartmontools
2023-09-06 00:57:08 -05:00
sqlite
2023-09-05 23:11:14 -05:00
unzip
watchexec
wget
xh
zellij
zstd
];
};
2023-09-05 22:39:17 -05:00
users.users = {
daniel = {
isNormalUser = true;
home = "/home/daniel/.home";
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAPLXOjupz3ScYjgrF+ehrbp9OvGAWQLI6fplX6w9Ijb daniel@lyte.dev"
];
2023-09-06 00:57:08 -05:00
group = "daniel";
extraGroups = [ "users" "wheel" "video" ];
2023-09-05 22:39:17 -05:00
packages = [ ];
};
root = {
openssh.authorizedKeys.keys = config.users.users.daniel.openssh.authorizedKeys.keys;
};
};
i18n = {
defaultLocale = "en_US.UTF-8";
};
services = {
xserver = {
layout = "us";
xkbOptions = "ctrl:nocaps";
};
openssh = {
enable = true;
2023-09-05 23:11:14 -05:00
settings = {
PasswordAuthentication = false;
};
2023-09-18 09:02:00 -05:00
# TODO: tailscale can handle this I think...?
2023-09-22 12:56:48 -05:00
openFirewall = lib.mkDefault true;
2023-09-05 23:11:14 -05:00
# listenAddresses = [
# { addr = "0.0.0.0"; port = 22; }
# ];
};
tailscale = {
enable = true;
useRoutingFeatures = lib.mkDefault "client";
2023-09-05 22:39:17 -05:00
};
2023-09-05 23:51:32 -05:00
fwupd.enable = true;
smartd.enable = true;
2023-09-05 22:39:17 -05:00
};
console = {
font = "Lat2-Terminus16";
useXkbConfig = true;
earlySetup = true;
2023-09-19 20:56:24 -05:00
colors = [
"111111"
"f92672"
"a6e22e"
"f4bf75"
"66d9ef"
"ae81ff"
"a1efe4"
"f8f8f2"
"75715e"
"f92672"
"a6e22e"
"f4bf75"
"66d9ef"
"ae81ff"
"a1efe4"
"f9f8f5"
];
2023-09-05 22:39:17 -05:00
};
networking = {
useDHCP = lib.mkDefault true;
2023-09-05 23:11:14 -05:00
firewall = {
enable = lib.mkDefault true;
allowPing = lib.mkDefault true;
2023-09-22 12:56:48 -05:00
allowedTCPPorts = lib.mkDefault [ 22 ];
2023-09-05 23:11:14 -05:00
allowedUDPPorts = lib.mkDefault [ ];
};
2023-09-05 22:39:17 -05:00
};
nix = {
settings = {
experimental-features = lib.mkDefault [ "nix-command" "flakes" ];
2023-09-06 00:57:08 -05:00
substituters = [
"https://nix.h.lyte.dev"
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
];
trusted-public-keys = [
"h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
2023-09-05 22:39:17 -05:00
};
};
nixpkgs = {
config = {
allowUnfree = true;
};
hostPlatform = lib.mkDefault "x86_64-linux";
};
2023-09-05 23:51:32 -05:00
programs = {
fish = {
enable = true;
};
tmux = {
enable = true;
clock24 = true;
};
traceroute.enable = true;
git = {
enable = true;
lfs = {
2023-09-05 22:39:17 -05:00
enable = true;
};
};
2023-09-28 12:29:21 -05:00
# https://github.com/nix-community/home-manager/issues/3113
dconf.enable = true;
2023-09-05 23:51:32 -05:00
};
2023-09-05 22:39:17 -05:00
time = {
timeZone = "America/Chicago";
};
users = {
defaultUserShell = pkgs.fish;
};
}