Modularizing the setup

This commit is contained in:
2025-08-20 10:08:10 -04:00
parent ecd8b1c9cf
commit a2ebeed8c6
9 changed files with 202 additions and 176 deletions

View File

@@ -8,177 +8,26 @@
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./modules/shares.nix
./modules/sops.nix
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.supportedFilesystems = [ "vfat" "ext4" "cifs" ];
boot.kernelModules = [ "fuse" "coretemp" "cifs" ];
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
systemd.tmpfiles.rules = [
"d /mnt/books 0755 root root -"
"d /mnt/books_extra 0755 root root -"
"d /mnt/music 0755 root root -"
"d /mnt/music_ext 0755 root root -"
"d /mnt/games 0755 root root -"
"d /mnt/games_ext 0755 root root -"
"d /mnt/roms_ext 0755 root root -"
"d /mnt/podcasts 0755 root root -"
"d /mnt/audiobooks 0755 root root -"
];
fileSystems."/mnt/books" = {
device = "//10.0.0.76/Books";
fsType = "cifs";
options = [
"credentials=/run/secrets/smb"
"vers=3.0"
"uid=1000" "gid=1000"
"file_mode=0664" "dir_mode=0775"
"rw" "iocharset=utf8" "cache=strict" "mfsymlinks"
"_netdev" "nofail"
"x-systemd.automount" "noauto"
"x-systemd.idle-timeout=10min"
boot = {
kernelPackages = pkgs.linuxPackages_latest;
initrd.availableKernelModules = [
"xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"
];
};
fileSystems."/mnt/books_ext" = {
device = "//10.0.0.76/books_ext";
fsType = "cifs";
options = [
"credentials=/run/secrets/smb"
"vers=3.0"
"uid=1000" "gid=1000"
"file_mode=0664" "dir_mode=0775"
"rw" "iocharset=utf8" "cache=strict" "mfsymlinks"
"_netdev" "nofail"
"x-systemd.automount" "noauto"
"x-systemd.idle-timeout=10min"
];
};
fileSystems."/mnt/music" = {
device = "//10.0.0.76/music";
fsType = "cifs";
options = [
"credentials=/run/secrets/smb"
"vers=3.0"
"uid=1000" "gid=1000"
"file_mode=0664" "dir_mode=0775"
"rw" "iocharset=utf8" "cache=strict" "mfsymlinks"
"_netdev" "nofail"
"x-systemd.automount" "noauto"
"x-systemd.idle-timeout=10min"
];
};
fileSystems."/mnt/music_ext" = {
device = "//10.0.0.76/music_ext";
fsType = "cifs";
options = [
"credentials=/run/secrets/smb"
"vers=3.0"
"uid=1000" "gid=1000"
"file_mode=0664" "dir_mode=0775"
"rw" "iocharset=utf8" "cache=strict" "mfsymlinks"
"_netdev" "nofail"
"x-systemd.automount" "noauto"
"x-systemd.idle-timeout=10min"
];
};
fileSystems."/mnt/games" = {
device = "//10.0.0.76/games";
fsType = "cifs";
options = [
"credentials=/run/secrets/smb"
"vers=3.0"
"uid=1000" "gid=1000"
"file_mode=0664" "dir_mode=0775"
"rw" "iocharset=utf8" "cache=strict" "mfsymlinks"
"_netdev" "nofail"
"x-systemd.automount" "noauto"
"x-systemd.idle-timeout=10min"
];
};
fileSystems."/mnt/games_ext" = {
device = "//10.0.0.76/games_ext";
fsType = "cifs";
options = [
"credentials=/run/secrets/smb"
"vers=3.0"
"uid=1000" "gid=1000"
"file_mode=0664" "dir_mode=0775"
"rw" "iocharset=utf8" "cache=strict" "mfsymlinks"
"_netdev" "nofail"
"x-systemd.automount" "noauto"
"x-systemd.idle-timeout=10min"
];
};
fileSystems."/mnt/roms_ext" = {
device = "//10.0.0.76/roms_ext";
fsType = "cifs";
options = [
"credentials=/run/secrets/smb"
"vers=3.0"
"uid=1000" "gid=1000"
"file_mode=0664" "dir_mode=0775"
"rw" "iocharset=utf8" "cache=strict" "mfsymlinks"
"_netdev" "nofail"
"x-systemd.automount" "noauto"
"x-systemd.idle-timeout=10min"
];
};
fileSystems."/mnt/podcasts" = {
device = "//10.0.0.76/podcasts";
fsType = "cifs";
options = [
"credentials=/run/secrets/smb"
"vers=3.0"
"uid=1000" "gid=1000"
"file_mode=0664" "dir_mode=0775"
"rw" "iocharset=utf8" "cache=strict" "mfsymlinks"
"_netdev" "nofail"
"x-systemd.automount" "noauto"
"x-systemd.idle-timeout=10min"
];
};
fileSystems."/mnt/audiobooks" = {
device = "//10.0.0.76/audiobooks";
fsType = "cifs";
options = [
"credentials=/run/secrets/smb"
"vers=3.0"
"uid=1000" "gid=1000"
"file_mode=0664" "dir_mode=0775"
"rw" "iocharset=utf8" "cache=strict" "mfsymlinks"
"_netdev" "nofail"
"x-systemd.automount" "noauto"
"x-systemd.idle-timeout=10min"
];
};
sops.secrets.smb = {
sopsFile = ./secrets/smb.creds;
format = "binary";
mode = "0400";
owner = "root";
group = "root";
};
networking.hostName = "xps13"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# networking.wireless.backend = "iwd";
# networking.wireless.iwd.enable = true;
# networking.wireless.networks = {
# MyLocalTech = {
# pskRaw = "ac1030d721d26deb2c7db10073dfac73244e9621f4462e3e568017da03201e0e";
# };
# };
# networking.networkmanager.enable = true;
networking.wireless = {
enable = true;
userControlled.enable = true;
networks = {
MyLocalTech = {
pskRaw = "ac1030d721d26deb2c7db10073dfac73244e9621f4462e3e568017da03201e0e";
};
};
kernelModules = [ "fuse" "coretemp" "cifs" "kvm-intel" ];
initrd.kernelModules = [ "ath10k_pci" ];
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
supportedFilesystems = [ "vfat" "ext4" "cifs" ];
extraModulePackages = [ ];
extraModprobeConfig = ''
options ath10k_pcs irq_mode=1
options ath10k_core rawmode=1
'';
};
# Set your time zone.
time.timeZone = "America/New_York";
@@ -284,7 +133,6 @@
vim
curl
age
sops
];
# Some programs need SUID wrappers, can be configured further or are