From ef94432501acea02bd1011c8627d556f906581a4 Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Sat, 3 Aug 2024 16:48:50 -0500 Subject: [PATCH] deployed cirrostratus. --- flake.nix | 5 ++++ hosts/cirrostratus/default.nix | 22 +++++++++----- hosts/cirrostratus/disk-config.nix | 15 ++++++---- hosts/cirrostratus/hardware-configuration.nix | 29 +++++++++++++++++++ hosts/cirrus/default.nix | 2 -- hosts/remotepi-karp/default.nix | 2 +- 6 files changed, 58 insertions(+), 17 deletions(-) create mode 100644 hosts/cirrostratus/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 879173a..afdcb2e 100644 --- a/flake.nix +++ b/flake.nix @@ -95,6 +95,7 @@ gv-wsl = import ./hosts/wsl-workstation.nix {inherit inputs configLib;}; rockhole = import ./hosts/rockhole64 {inherit inputs configLib;}; cirrus = import ./hosts/cirrus {inherit inputs configLib;}; + cirrostratus = import ./hosts/cirrostratus {inherit inputs configLib;}; remotepi-karp = import ./hosts/remotepi-karp {inherit inputs configLib;}; }; @@ -118,6 +119,10 @@ hostname = "cal.venberg.xyz"; profiles.system.path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.cirrus; }; + cirrostratus = { + hostname = "cirrostratus"; + profiles.system.path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.cirrostratus; + }; }; sshUser = "root"; }; diff --git a/hosts/cirrostratus/default.nix b/hosts/cirrostratus/default.nix index 8bf753e..a6d1f80 100644 --- a/hosts/cirrostratus/default.nix +++ b/hosts/cirrostratus/default.nix @@ -12,7 +12,7 @@ inputs.nixpkgs.lib.nixosSystem { inputs.home-manager.nixosModules.home-manager inputs.disko.nixosModules.disko ./disk-config.nix - ./nginx.nix + ./hardware-configuration.nix ../../configs/nixos/common.nix ../../configs/nixos/tailscale.nix ../../configs/nixos/sshd.nix @@ -33,10 +33,10 @@ inputs.nixpkgs.lib.nixosSystem { networking.useNetworkd = true; systemd.network = { enable = true; - networks."eth0" = { - name = "eth0"; + networks."eno1" = { + name = "eno1"; DHCP = "yes"; - # address = ["10.10.10.31/24"]; + # address = ["10.10.10.30/24"]; # gateway = ["10.10.10.1"]; # dns = ["1.1.1.1"]; }; @@ -59,14 +59,20 @@ inputs.nixpkgs.lib.nixosSystem { }; }; imports = [ - ../../roles/home-manager/terminal.nix + ../../roles/home-manager/minimal-terminal.nix ../../configs/home-manager/common.nix inputs.nixvim.homeManagerModules.nixvim ]; }; - - # Bootloader. - boot.loader.grub.enable = true; + boot = { + # Bootloader. + # loader.grub.enable = true; + loader.systemd-boot.enable = true; + loader.efi.canTouchEfiVariables = true; + kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; + supportedFilesystems.zfs = true; + initrd.supportedFilesystems.zfs = true; + }; # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ]; diff --git a/hosts/cirrostratus/disk-config.nix b/hosts/cirrostratus/disk-config.nix index 3668834..de9511e 100644 --- a/hosts/cirrostratus/disk-config.nix +++ b/hosts/cirrostratus/disk-config.nix @@ -3,12 +3,12 @@ disk = { ssd = { type = "disk"; - device = "/dev/TODO"; + device = "/dev/disk/by-id/wwn-0x500a0751e138c24b"; content = { type = "gpt"; partitions = { ESP = { - size = "64M"; + size = "512M"; type = "EF00"; content = { type = "filesystem"; @@ -29,7 +29,7 @@ }; zfsa = { type = "disk"; - device = "/dev/TODO"; + device = "/dev/disk/by-id/wwn-0x5000cca27ed9174d"; content = { type = "gpt"; partitions = { @@ -45,7 +45,7 @@ }; zfsb = { type = "disk"; - device = "/dev/TODO"; + device = "/dev/disk/by-id/wwn-0x5000cca27ed8106c"; content = { type = "gpt"; partitions = { @@ -64,12 +64,15 @@ storage = { type = "zpool"; mode = "mirror"; - mountpoint = "/storage"; + options.mountpoint = "/storage"; + rootFsOptions = { + compression = "zstd"; + }; datasets = { dataset = { type = "zfs_fs"; - mountpoint = "/storage/dataset"; + options.mountpoint = "/storage/dataset"; }; }; }; diff --git a/hosts/cirrostratus/hardware-configuration.nix b/hosts/cirrostratus/hardware-configuration.nix new file mode 100644 index 0000000..1572ac6 --- /dev/null +++ b/hosts/cirrostratus/hardware-configuration.nix @@ -0,0 +1,29 @@ +# 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 = ["ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; + + # 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.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.eno2.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/cirrus/default.nix b/hosts/cirrus/default.nix index 2341bd2..82d58e7 100644 --- a/hosts/cirrus/default.nix +++ b/hosts/cirrus/default.nix @@ -67,8 +67,6 @@ inputs.nixpkgs.lib.nixosSystem { ]; }; - # Bootloader. - # boot.loader.systemd-boot.enable = true; boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"]; # Open ports in the firewall. diff --git a/hosts/remotepi-karp/default.nix b/hosts/remotepi-karp/default.nix index 7571f7e..b124dab 100644 --- a/hosts/remotepi-karp/default.nix +++ b/hosts/remotepi-karp/default.nix @@ -36,7 +36,7 @@ inputs.nixpkgs.lib.nixosSystem { networks."eth0" = { name = "eth0"; DHCP = "yes"; - # address = ["10.10.10.30/24"]; + # address = ["10.10.10.31/24"]; # gateway = ["10.10.10.1"]; # dns = ["1.1.1.1"]; };