diff --git a/flake.nix b/flake.nix index 9058f6f..e49a4be 100644 --- a/flake.nix +++ b/flake.nix @@ -126,6 +126,12 @@ ]; specialArgs = { inherit inputs outputs; }; }; + tortoise = lib.nixosSystem { + modules = [ + ./systems/tortoise + ]; + specialArgs = { inherit inputs outputs; }; + }; iso = lib.nixosSystem { modules = [ ./systems/iso diff --git a/systems/tortoise/default.nix b/systems/tortoise/default.nix new file mode 100644 index 0000000..962dc5f --- /dev/null +++ b/systems/tortoise/default.nix @@ -0,0 +1,37 @@ +{ inputs, ... }: +{ + imports = [ + "${inputs.self}/users/richie" + "${inputs.self}/common/global" + "${inputs.self}/common/optional/monitoring-agent.nix" + "${inputs.self}/common/optional/ssh_decrypt.nix" + "${inputs.self}/common/optional/systemd-boot.nix" + "${inputs.self}/common/optional/update.nix" + "${inputs.self}/common/optional/zerotier.nix" + ./hardware.nix + ]; + + boot.kernelParams = [ "panic=10" ]; + + networking = { + hostName = "tortoise"; + hostId = "161cbd68"; + firewall.enable = true; + networkmanager.enable = true; + }; + + services = { + openssh.ports = [ 867 ]; + }; + + systemd = { + enableEmergencyMode = false; + # Only takes effect if the board exposes a hardware watchdog device. + settings.Manager = { + RuntimeWatchdogSec = "30s"; + RebootWatchdogSec = "2m"; + }; + }; + + system.stateVersion = "26.11"; +} diff --git a/systems/tortoise/hardware.nix b/systems/tortoise/hardware.nix new file mode 100644 index 0000000..24d1c0c --- /dev/null +++ b/systems/tortoise/hardware.nix @@ -0,0 +1,69 @@ +{ + 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-ata-Samsung_SSD_870_EVO_4TB_S757NL0Y315721H-part2" = { + device = "/dev/disk/by-id/ata-Samsung_SSD_870_EVO_4TB_S757NL0Y315721H-part2"; + bypassWorkqueues = true; + allowDiscards = true; + }; + }; + 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/223B-9F08"; + 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/tortoise.nix b/users/richie/systems/tortoise.nix new file mode 100644 index 0000000..6bbef61 --- /dev/null +++ b/users/richie/systems/tortoise.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ../home/global.nix + ]; +}