From a7c3d07078d0ca67afadd6fb24ab4b60b38c1109 Mon Sep 17 00:00:00 2001 From: tdback Date: Sun, 26 Jan 2025 11:31:00 -0500 Subject: hosts: overhauled host configurations --- hosts/odin/default.nix | 67 +++++++++++++++++++------------------- hosts/odin/filesystems/default.nix | 17 ++++++++++ hosts/odin/hardware.nix | 38 --------------------- hosts/odin/modules/default.nix | 50 ++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+), 72 deletions(-) create mode 100644 hosts/odin/filesystems/default.nix delete mode 100644 hosts/odin/hardware.nix create mode 100644 hosts/odin/modules/default.nix (limited to 'hosts/odin') diff --git a/hosts/odin/default.nix b/hosts/odin/default.nix index 52a2ace..e413d07 100644 --- a/hosts/odin/default.nix +++ b/hosts/odin/default.nix @@ -1,8 +1,36 @@ -{ lib, inputs, ... }: +{ + inputs, + lib, + ... +}: { system.stateVersion = "24.05"; - imports = [ ./hardware.nix ]; + imports = [ + ./filesystems + ./modules + ]; + + hardware = { + enableRedistributableFirmware = true; + cpu.intel.updateMicrocode = true; + }; + + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ehci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + "sr_mod" + ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.zfs.extraPools = [ "tank" ]; home-manager = { useGlobalPkgs = true; @@ -14,9 +42,11 @@ }; }; + time.timeZone = "America/Detroit"; networking = { hostName = "odin"; - hostId = "bd03847d"; # Required for ZFS support. + # A host ID is required when enabling ZFS. + hostId = "bd03847d"; nameservers = [ "10.44.0.1" ]; defaultGateway.address = "10.44.0.1"; interfaces.eno1 = { @@ -27,35 +57,4 @@ }; }; }; - - time.timeZone = "America/Detroit"; - - boot = { - loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - }; - zfs.extraPools = [ "tank" ]; - }; - - services.zquota = { - enable = true; - quotas = { - "tank/backups" = 512; - "tank/media" = 1536; - }; - }; - - programs.motd = { - enable = true; - networkInterfaces = [ "eno1" ]; - servicesToCheck = [ - "caddy" - "immich-machine-learning" - "immich-server" - "postgresql" - "redis-immich" - "zfs-zed" - ]; - }; } diff --git a/hosts/odin/filesystems/default.nix b/hosts/odin/filesystems/default.nix new file mode 100644 index 0000000..410e425 --- /dev/null +++ b/hosts/odin/filesystems/default.nix @@ -0,0 +1,17 @@ +{ + fileSystems."/" = { + device = "/dev/disk/by-uuid/f3bedccb-3f2b-49ae-9be4-5ec9fe683027"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/78C3-E7F8"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + swapDevices = [ ]; +} diff --git a/hosts/odin/hardware.nix b/hosts/odin/hardware.nix deleted file mode 100644 index 00210c4..0000000 --- a/hosts/odin/hardware.nix +++ /dev/null @@ -1,38 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/f3bedccb-3f2b-49ae-9be4-5ec9fe683027"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/78C3-E7F8"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; - - swapDevices = [ ]; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/hosts/odin/modules/default.nix b/hosts/odin/modules/default.nix new file mode 100644 index 0000000..0a7aba1 --- /dev/null +++ b/hosts/odin/modules/default.nix @@ -0,0 +1,50 @@ +{ + modules = { + containers.watchtower.enable = true; + containers.pinchflat = { + enable = true; + mediaDir = "/tank/media/yt"; + }; + containers.freshrss = { + enable = true; + url = "fresh.brownbread.net"; + }; + containers.lubelogger = { + enable = true; + url = "garage.brownbread.net"; + }; + containers.vaultwarden = { + enable = true; + url = "steel-mountain.brownbread.net"; + }; + containers.jellyfin = { + enable = true; + url = "buttered.brownbread.net"; + mediaDir = "/tank/media"; + }; + services.immich = { + enable = true; + url = "photographs.brownbread.net"; + mediaDir = "/tank/immich"; + }; + scripts.motd = { + enable = true; + networkInterfaces = [ "eno1" ]; + servicesToCheck = [ + "caddy" + "immich-machine-learning" + "immich-server" + "postgresql" + "redis-immich" + "zfs-zed" + ]; + }; + scripts.zquota = { + enable = true; + quotas = { + "tank/backups" = 512; + "tank/media" = 1536; + }; + }; + }; +} -- cgit v1.2.3