this repo has no description
1
fork

Configure Feed

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

Fix disks.nix

Ben C bcd557cd acf23ff7

+38 -40
+38 -40
nixosModules/disks.nix
··· 1 - {...}: { 1 + { ... }: 2 + { 2 3 config, 3 4 lib, 4 5 ... 5 - }: { 6 + }: 7 + { 6 8 options.cow.disks = { 7 9 enable = lib.mkEnableOption "allowing cow to create a UEFI-compatible layout"; 8 10 swap = lib.mkEnableOption "look for and swapon a swap device"; ··· 14 16 }; 15 17 }; 16 18 17 - config = let 18 - conf = config.cow.disks; 19 - prefix = 20 - if conf.partition-prefix == null 21 - then "" 22 - else "${conf.partition-prefix}-"; 23 - primaryPart = "/dev/disk/by-partlabel/${prefix}NIXOS"; 24 - swapPart = "/dev/disk/by-partlabel/${prefix}SWAP"; 25 - bootPart = "/dev/disk/by-partlabel/${prefix}BOOT"; 26 - cryptroot = "/dev/mapper/cryptroot"; 27 - cryptswap = "/dev/mapper/cryptswap"; 28 - in 19 + config = 20 + let 21 + conf = config.cow.disks; 22 + prefix = if conf.partition-prefix == null then "" else "${conf.partition-prefix}-"; 23 + primaryPart = "/dev/disk/by-partlabel/${prefix}NIXOS"; 24 + swapPart = "/dev/disk/by-partlabel/${prefix}SWAP"; 25 + bootPart = "/dev/disk/by-partlabel/${prefix}BOOT"; 26 + cryptroot = "/dev/mapper/cryptroot"; 27 + cryptswap = "/dev/mapper/cryptswap"; 28 + in 29 29 lib.mkIf config.cow.disks.enable { 30 + boot.initrd.kernelModules = [ 31 + "nvme" 32 + "xhci_pci" 33 + "ahci" 34 + "usbhid" 35 + "usb_storage" 36 + "sd_mod" 37 + ]; 30 38 boot.initrd.luks.devices = lib.mkIf conf.luks { 31 39 "cryptroot" = { 32 40 device = primaryPart; 33 - fallbackToPassword = true; 34 41 }; 35 42 "cryptswap" = { 36 43 device = swapPart; 37 - fallbackToPassword = true; 38 44 }; 39 45 }; 40 46 swapDevices = [ 41 47 { 42 - device = 43 - if conf.luks 44 - then cryptswap 45 - else swapPart; 48 + device = if conf.luks then cryptswap else swapPart; 46 49 } 47 50 ]; 48 51 fileSystems."/boot" = { ··· 58 61 ]; 59 62 }; 60 63 fileSystems."/nix" = lib.mkIf config.cow.imperm.enable { 61 - device = 62 - if conf.luks 63 - then cryptroot 64 - else primaryPart; 64 + device = if conf.luks then cryptroot else primaryPart; 65 65 fsType = "ext4"; 66 66 options = [ 67 67 "lazytime" ··· 71 71 neededForBoot = true; 72 72 }; 73 73 fileSystems."/" = 74 - if config.cow.imperm.enable 75 - then { 76 - fsType = "tmpfs"; 77 - options = [ 78 - "size=512M" 79 - "mode=755" 80 - ]; 81 - neededForBoot = true; 82 - } 83 - else { 84 - device = 85 - if conf.luks 86 - then cryptroot 87 - else primaryPart; 88 - fsType = "ext4"; 89 - }; 74 + if config.cow.imperm.enable then 75 + { 76 + fsType = "tmpfs"; 77 + options = [ 78 + "size=512M" 79 + "mode=755" 80 + ]; 81 + neededForBoot = true; 82 + } 83 + else 84 + { 85 + device = if conf.luks then cryptroot else primaryPart; 86 + fsType = "ext4"; 87 + }; 90 88 fileSystems."/home" = lib.mkIf config.cow.imperm.enable { 91 89 fsType = "tmpfs"; 92 90 options = [