filebitch.r: fix luks devices syntax

This commit is contained in:
lassulus 2020-11-05 16:56:27 +01:00
parent f36fd9b46f
commit 34ac9e7143

View File

@ -1,7 +1,7 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
byid = dev: "/dev/disk/by-id/" + dev; byid = dev: "/dev/disk/by-id/" + dev;
keyFile = byid "usb-SMI_USB_DISK_AA08061700009650-0:0"; keyFile = byid "usb-SMI_USB_DISK_AA08061700009650-0:0";
in in
{ {
imports = imports =
@ -19,7 +19,7 @@ in
boot.tmpOnTmpfs = true; boot.tmpOnTmpfs = true;
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
"xhci_pci" "ahci" "ohci_pci" "ehci_pci" "usb_storage" "usbhid" "sd_mod" "xhci_pci" "ahci" "ohci_pci" "ehci_pci" "usb_storage" "usbhid" "sd_mod"
"raid456" "raid456"
"usbhid" "usbhid"
@ -77,20 +77,18 @@ in
networking.hostId = "54d97450"; # required for zfs use networking.hostId = "54d97450"; # required for zfs use
boot.initrd.luks.devices = let boot.initrd.luks.devices = let
usbkey = name: device: { usbkey = device: {
inherit name device keyFile; inherit device keyFile;
keyFileSize = 2048; keyFileSize = 2048;
preLVM = true; preLVM = true;
}; };
in [ in {
((usbkey "swap" (byid "ata-INTEL_SSDSA2M080G2GC_CVPO013300WD080BGN-part2")) swap = ((usbkey (byid "ata-INTEL_SSDSA2M080G2GC_CVPO013300WD080BGN-part2"))
// { allowDiscards = true; } ) // { allowDiscards = true; } );
((usbkey "root" (byid "ata-INTEL_SSDSA2M080G2GC_CVPO013300WD080BGN-part3")) root = ((usbkey (byid "ata-INTEL_SSDSA2M080G2GC_CVPO013300WD080BGN-part3"))
// { allowDiscards = true; } ) // { allowDiscards = true; } );
(usbkey "125" "/dev/md125") md125 = usbkey "/dev/md125";
(usbkey "126" "/dev/md126") md126 = usbkey "/dev/md126";
(usbkey "127" "/dev/md127") md127 = usbkey "/dev/md127";
]; };
} }