This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

neoprism: turn disk.nix into nixos module

+125 -114
+121 -113
machines/neoprism/disk.nix
··· 1 - { lib, ... }: 2 - { 3 - disk = (lib.genAttrs [ "/dev/nvme0n1" "/dev/nvme1n1" ] (disk: { 4 - type = "disk"; 5 - device = disk; 6 - content = { 7 - type = "gpt"; 8 - partitions = { 9 - boot = { 10 - size = "1M"; 11 - type = "EF02"; 12 - }; 13 - ESP = { 14 - size = "1G"; 15 - content = { 16 - type = "mdraid"; 17 - name = "boot"; 18 - }; 19 - }; 20 - zfs = { 21 - size = "100%"; 22 - content = { 23 - type = "zfs"; 24 - pool = "zroot"; 25 - }; 26 - }; 27 - }; 28 - }; 29 - })) // { 30 - hdd1 = { 1 + { lib, ... }: { 2 + disko.imageBuilder.extraRootModules = [ 3 + "zfs" 4 + ]; 5 + disko.tests.extraConfig = { 6 + services.mingetty.autologinUser = "root"; 7 + }; 8 + disko.devices = { 9 + disk = (lib.genAttrs [ "/dev/nvme0n1" "/dev/nvme1n1" ] (disk: { 31 10 type = "disk"; 32 - device = "/dev/sda"; 11 + device = disk; 12 + imageSize = "3G"; 33 13 content = { 34 - type = "zfs"; 35 - pool = "tank"; 36 - }; 37 - }; 38 - }; 39 - mdadm = { 40 - boot = { 41 - type = "mdadm"; 42 - level = 1; 43 - metadata = "1.0"; 44 - content = { 45 - type = "filesystem"; 46 - format = "vfat"; 47 - mountpoint = "/boot"; 48 - }; 49 - }; 50 - }; 51 - zpool = { 52 - zroot = { 53 - type = "zpool"; 54 - mode = "mirror"; 55 - mountpoint = "/"; 56 - rootFsOptions = { 57 - }; 58 - datasets = { 59 - reserved = { 60 - type = "zfs_fs"; 61 - options.refreservation = "1G"; 62 - }; 63 - pairprogramming = { 64 - type = "zfs_fs"; 65 - mountpoint = "/home/pairprogramming"; 66 - options = { 67 - canmount = "noauto"; 14 + type = "gpt"; 15 + partitions = { 16 + boot = { 17 + size = "1M"; 18 + type = "EF02"; 68 19 }; 20 + ESP = { 21 + size = "1G"; 22 + content = { 23 + type = "mdraid"; 24 + name = "boot"; 25 + }; 26 + }; 27 + zfs = { 28 + size = "100%"; 29 + content = { 30 + type = "zfs"; 31 + pool = "zroot"; 32 + }; 33 + }; 34 + }; 35 + }; 36 + })) // { 37 + hdd1 = { 38 + type = "disk"; 39 + device = "/dev/sda"; 40 + content = { 41 + type = "zfs"; 42 + pool = "tank"; 43 + }; 44 + }; 45 + }; 46 + mdadm = { 47 + boot = { 48 + type = "mdadm"; 49 + level = 1; 50 + metadata = "1.0"; 51 + content = { 52 + type = "filesystem"; 53 + format = "vfat"; 54 + mountpoint = "/boot"; 55 + }; 56 + }; 57 + }; 58 + zpool = { 59 + zroot = { 60 + type = "zpool"; 61 + mode = "mirror"; 62 + mountpoint = "/"; 63 + rootFsOptions = { 64 + }; 65 + datasets = { 66 + reserved = { 67 + type = "zfs_fs"; 68 + options.refreservation = "1G"; 69 + }; 70 + pairprogramming = { 71 + type = "zfs_fs"; 72 + mountpoint = "/home/pairprogramming"; 73 + options = { 74 + canmount = "noauto"; 75 + }; 69 76 77 + }; 70 78 }; 71 79 }; 72 - }; 73 - tank = { 74 - type = "zpool"; 75 - datasets = { 76 - reserved = { 77 - type = "zfs_fs"; 78 - options.refreservation = "1G"; 79 - }; 80 - containers = { 81 - type = "zfs_fs"; 82 - mountpoint = "/var/lib/containers"; 83 - options = { 84 - canmount = "noauto"; 80 + tank = { 81 + type = "zpool"; 82 + datasets = { 83 + reserved = { 84 + type = "zfs_fs"; 85 + options.refreservation = "1G"; 85 86 }; 86 - }; 87 - home = { 88 - type = "zfs_fs"; 89 - mountpoint = "/home"; 90 - options = { 91 - canmount = "noauto"; 87 + containers = { 88 + type = "zfs_fs"; 89 + mountpoint = "/var/lib/containers"; 90 + options = { 91 + canmount = "noauto"; 92 + }; 92 93 }; 93 - }; 94 - srv = { 95 - type = "zfs_fs"; 96 - mountpoint = "/srv"; 97 - options = { 98 - canmount = "noauto"; 94 + home = { 95 + type = "zfs_fs"; 96 + mountpoint = "/home"; 97 + options = { 98 + canmount = "noauto"; 99 + }; 99 100 }; 100 - }; 101 - libvirt = { 102 - type = "zfs_fs"; 103 - mountpoint = "/var/lib/libvirt"; 104 - options = { 105 - canmount = "noauto"; 101 + srv = { 102 + type = "zfs_fs"; 103 + mountpoint = "/srv"; 104 + options = { 105 + canmount = "noauto"; 106 + }; 106 107 }; 108 + libvirt = { 109 + type = "zfs_fs"; 110 + mountpoint = "/var/lib/libvirt"; 111 + options = { 112 + canmount = "noauto"; 113 + }; 114 + }; 115 + # encrypted = { 116 + # type = "zfs_fs"; 117 + # options = { 118 + # canmount = "noauto"; 119 + # mountpoint = "none"; 120 + # encryption = "aes-256-gcm"; 121 + # keyformat = "passphrase"; 122 + # keylocation = "prompt"; 123 + # }; 124 + # }; 125 + # "encrypted/download" = { 126 + # type = "zfs_fs"; 127 + # mountpoint = "/var/download"; 128 + # options = { 129 + # canmount = "noauto"; 130 + # }; 131 + # }; 107 132 }; 108 - # encrypted = { 109 - # type = "zfs_fs"; 110 - # options = { 111 - # canmount = "noauto"; 112 - # mountpoint = "none"; 113 - # encryption = "aes-256-gcm"; 114 - # keyformat = "passphrase"; 115 - # keylocation = "prompt"; 116 - # }; 117 - # }; 118 - # "encrypted/download" = { 119 - # type = "zfs_fs"; 120 - # mountpoint = "/var/download"; 121 - # options = { 122 - # canmount = "noauto"; 123 - # }; 124 - # }; 125 133 }; 126 134 }; 127 135 };
+4 -1
machines/neoprism/physical.nix
··· 5 5 ./config.nix 6 6 (modulesPath + "/installer/scan/not-detected.nix") 7 7 self.inputs.disko.nixosModules.disko 8 + ./disk.nix 8 9 ]; 9 10 10 - disko.devices = import ./disk.nix; 11 11 networking.hostId = "9c0a74ac"; 12 12 boot.kernelPackages = pkgs.zfs.latestCompatibleLinuxPackages; 13 13 14 14 boot.loader.grub.enable = true; 15 15 boot.loader.grub.efiSupport = true; 16 16 boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "sd_mod" ]; 17 + boot.kernelParams = [ 18 + "boot.shell_on_fail" 19 + ]; 17 20 boot.kernelModules = [ "kvm-amd" ]; 18 21 hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 19 22