From 596308634840634c216e8f1f1db8920886df0aa4 Mon Sep 17 00:00:00 2001 From: Caroline Larimore Date: Sat, 8 Feb 2025 23:19:40 -0800 Subject: migration: start copenhagen config --- .../systems/x86_64-linux/copenhagen/default.nix | 20 ++++++++ .../systems/x86_64-linux/copenhagen/hardware.nix | 55 ++++++++++++++++++++++ .../systems/x86_64-linux/copenhagen/network.nix | 20 ++++++++ 3 files changed, 95 insertions(+) create mode 100644 snowfall/systems/x86_64-linux/copenhagen/default.nix create mode 100644 snowfall/systems/x86_64-linux/copenhagen/hardware.nix create mode 100644 snowfall/systems/x86_64-linux/copenhagen/network.nix (limited to 'snowfall/systems/x86_64-linux') diff --git a/snowfall/systems/x86_64-linux/copenhagen/default.nix b/snowfall/systems/x86_64-linux/copenhagen/default.nix new file mode 100644 index 0000000..38705a8 --- /dev/null +++ b/snowfall/systems/x86_64-linux/copenhagen/default.nix @@ -0,0 +1,20 @@ +{ lib, pkgs, namespace, ... }: + +with lib; with lib.${namespace}; { + imports = [ + ./hardware.nix + ./network.nix + ]; + + cxl = { + system = { + hostname = "copenhagen"; + id = "a50062ff"; + + impermanence.enable = true; + impermanence.home.enable = true; + }; + }; + + system.stateVersion = "23.11"; +} \ No newline at end of file diff --git a/snowfall/systems/x86_64-linux/copenhagen/hardware.nix b/snowfall/systems/x86_64-linux/copenhagen/hardware.nix new file mode 100644 index 0000000..c248fcf --- /dev/null +++ b/snowfall/systems/x86_64-linux/copenhagen/hardware.nix @@ -0,0 +1,55 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + boot = { + loader.grub = { + enable = true; + + zfsSupport = true; + efiSupport = true; + efiInstallAsRemovable = true; + + mirroredBoots = [ + { devices = [ "nodev" ]; path = "/boot"; } + ]; + }; + + initrd = { + availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + kernelModules = [ ]; + + #TODO: re-enable impermanence + # postDeviceCommands = lib.mkAfter '' + # zfs rollback -r zpool/root@blank && zfs rollback -r zpool/home@blank + # ''; + + postMountCommands = lib.mkAfter '' + chmod u=rw,g=,o= /secrets + ''; + }; + + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + + supportedFilesystems = [ "ntfs" ]; + }; + + fileSystems = { + "/" = { fsType = "zfs"; neededForBoot = true; device = "zpool/root"; }; + "/nix" = { fsType = "zfs"; neededForBoot = true; device = "zpool/nix"; }; + "/home" = { fsType = "zfs"; neededForBoot = true; device = "zpool/home"; }; + "/persist" = { fsType = "zfs"; neededForBoot = true; device = "zpool/persist"; }; + "/secrets" = { fsType = "zfs"; neededForBoot = true; device = "zpool/secrets"; }; + + "/boot" = { fsType = "vfat"; device = "/dev/disk/by-uuid/DF61-E3BD"; }; + + "/mnt/old" = { fsType = "ext4"; device = "/dev/disk/by-label/box"; }; + }; + + swapDevices = [ ]; + + hardware.enableRedistributableFirmware = true; + hardware.cpu.intel.updateMicrocode = true; + + nixpkgs.hostPlatform = "x86_64-linux"; +} diff --git a/snowfall/systems/x86_64-linux/copenhagen/network.nix b/snowfall/systems/x86_64-linux/copenhagen/network.nix new file mode 100644 index 0000000..affe697 --- /dev/null +++ b/snowfall/systems/x86_64-linux/copenhagen/network.nix @@ -0,0 +1,20 @@ +{ ... }: + +{ + networking = { + useDHCP = true; + + wireless = { + enable = true; + + # Import /etc/wpa_supplicant.conf networks + allowAuxiliaryImperativeNetworks = true; + }; + + firewall.enable = true; + }; + + environment.etc."wpa_supplicant.conf" = { + source = "/secrets/wireless.conf"; + }; +} -- cgit v1.2.3