diff --git a/.github/workflows/build_systems.yml b/.github/workflows/build_systems.yml index 63d92a1..fab4933 100644 --- a/.github/workflows/build_systems.yml +++ b/.github/workflows/build_systems.yml @@ -16,6 +16,7 @@ jobs: - "jeeves" - "muninn" - "rhapsody-in-green" + - "router" steps: - uses: actions/checkout@v4 - name: Build default package diff --git a/flake.nix b/flake.nix index 3fb1fcc..a7332f1 100644 --- a/flake.nix +++ b/flake.nix @@ -100,6 +100,10 @@ ]; specialArgs = {inherit inputs outputs;}; }; + router = lib.nixosSystem { + modules = [./systems/router]; + specialArgs = {inherit inputs outputs;}; + }; }; }; } diff --git a/systems/router/default.nix b/systems/router/default.nix new file mode 100644 index 0000000..2918337 --- /dev/null +++ b/systems/router/default.nix @@ -0,0 +1,32 @@ +{ + imports = [ + ../../users/richie + ../../common/global + ../../common/optional/systemd-boot.nix + ../../common/optional/zerotier.nix + ./hardware.nix + ]; + + networking = { + hostName = "router"; + hostId = "c58bbb8b"; + firewall.enable = true; + networkmanager.enable = true; + }; + + security.rtkit.enable = true; + + services = { + + openssh.ports = [ 972 ]; + + snapshot_manager.enable = true; + + zfs = { + trim.enable = true; + autoScrub.enable = true; + }; + }; + + system.stateVersion = "24.05"; +} diff --git a/systems/router/hardware.nix b/systems/router/hardware.nix new file mode 100644 index 0000000..3c2cd8c --- /dev/null +++ b/systems/router/hardware.nix @@ -0,0 +1,67 @@ +{ config, lib, modulesPath, ... }: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot = { + initrd = { + availableKernelModules = [ + "ahci" + "ehci_pci" + "nvme" + "sd_mod" + "usb_storage" + "usbhid" + "xhci_pci" + ]; + kernelModules = [ ]; + luks.devices."luks-root-pool-wwn-0x500a0751e6c3c01c-part2"= { + device = "/dev/disk/by-id/wwn-0x500a0751e6c3c01c-part2"; + bypassWorkqueues = true; + allowDiscards = true; + fallbackToPassword = true; + keyFileSize = 4096; + keyFile = "/dev/disk/by-id/usb-Samsung_Flash_Drive_FIT_0374220080010715-0:0"; + }; + }; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + }; + + fileSystems = { + "/" = lib.mkDefault { + device = "root_pool/root"; + fsType = "zfs"; + }; + + "/home" = { + device = "root_pool/home"; + fsType = "zfs"; + }; + + "/var" = { + device = "root_pool/var"; + fsType = "zfs"; + }; + + "/nix" = { + device = "root_pool/nix"; + fsType = "zfs"; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/12CE-A600"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + }; + + swapDevices = [ ]; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/users/richie/systems/router.nix b/users/richie/systems/router.nix new file mode 100644 index 0000000..6bbef61 --- /dev/null +++ b/users/richie/systems/router.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ../home/global.nix + ]; +}