From 61e61f09085df647c440783552ba8ca167ecdbcf Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sun, 6 Dec 2020 11:03:23 +0100 Subject: [PATCH] Reorganise hardware configuration Fixes #6. --- machines/nunotaba/configuration.nix | 11 ---------- machines/nunotaba/hardware-configuration.nix | 9 ++++++++ machines/sayuri/configuration.nix | 22 -------------------- machines/sayuri/hardware-configuration.nix | 19 +++++++++++++++++ 4 files changed, 28 insertions(+), 33 deletions(-) diff --git a/machines/nunotaba/configuration.nix b/machines/nunotaba/configuration.nix index eddb490..72e026d 100644 --- a/machines/nunotaba/configuration.nix +++ b/machines/nunotaba/configuration.nix @@ -20,16 +20,5 @@ }; }; - boot.loader.grub.device = "/dev/disk/by-id/ata-INTEL_SSDSC2KB480G7_PHYS749202D6480BGN"; - - boot.initrd.luks.devices = { - root = { - name = "root"; - device = "/dev/disk/by-uuid/f3a2fa57-581b-4e95-9a45-d61cda9edc54"; - preLVM = true; - allowDiscards = true; - }; - }; - networking.hostName = "nunotaba"; } diff --git a/machines/nunotaba/hardware-configuration.nix b/machines/nunotaba/hardware-configuration.nix index b94f7d2..b4728a0 100644 --- a/machines/nunotaba/hardware-configuration.nix +++ b/machines/nunotaba/hardware-configuration.nix @@ -8,9 +8,18 @@ boot = { kernelModules = [ "kvm-intel" ]; extraModulePackages = [ ]; + loader.grub.device = "/dev/disk/by-id/ata-INTEL_SSDSC2KB480G7_PHYS749202D6480BGN"; initrd = { availableKernelModules = [ "ahci" "ehci_pci" "rtsx_pci_sdmmc" "sd_mod" "usb_storage" "usbhid" "xhci_pci" ]; kernelModules = [ "dm-snapshot" ]; + luks.devices = { + root = { + name = "root"; + device = "/dev/disk/by-uuid/f3a2fa57-581b-4e95-9a45-d61cda9edc54"; + preLVM = true; + allowDiscards = true; + }; + }; }; }; diff --git a/machines/sayuri/configuration.nix b/machines/sayuri/configuration.nix index 3d6fc59..0d6e4d8 100644 --- a/machines/sayuri/configuration.nix +++ b/machines/sayuri/configuration.nix @@ -20,27 +20,5 @@ }; }; - boot.loader.grub.device = "/dev/disk/by-id/ata-MTFDDAK256TBN-1AR15ABHA_UFZMQ01ZR50NMM"; - - boot.initrd.luks.devices = { - root = { - name = "root"; - device = "/dev/disk/by-uuid/d7e4d213-8a13-4059-a011-0f68081e86d8"; - preLVM = true; - allowDiscards = true; - }; - }; - - fileSystems.data = { - mountPoint = "/data"; - device = "/dev/mapper/data"; - encrypted = { - label = "data"; - enable = true; - blkDev = "/dev/disk/by-uuid/576088d4-9aae-4159-a028-feadb2621a1a"; - keyFile = "/mnt-root" + toString ./secrets/data_luks_key; - }; - }; - networking.hostName = "sayuri"; } diff --git a/machines/sayuri/hardware-configuration.nix b/machines/sayuri/hardware-configuration.nix index e3a0654..6a9265d 100644 --- a/machines/sayuri/hardware-configuration.nix +++ b/machines/sayuri/hardware-configuration.nix @@ -8,9 +8,18 @@ boot = { kernelModules = [ "kvm-intel" ]; extraModulePackages = [ ]; + loader.grub.device = "/dev/disk/by-id/ata-MTFDDAK256TBN-1AR15ABHA_UFZMQ01ZR50NMM"; initrd = { availableKernelModules = [ "ahci" "ehci_pci" "sd_mod" "usb_storage" "usbhid" "xhci_pci" ]; kernelModules = [ "dm-snapshot" ]; + luks.devices = { + root = { + name = "root"; + device = "/dev/disk/by-uuid/d7e4d213-8a13-4059-a011-0f68081e86d8"; + preLVM = true; + allowDiscards = true; + }; + }; }; }; @@ -24,6 +33,16 @@ device = "/dev/disk/by-uuid/c5bde64b-c629-438d-a78b-c4341796dae9"; fsType = "ext2"; }; + + "/data" = { + device = "/dev/mapper/data"; + encrypted = { + label = "data"; + enable = true; + blkDev = "/dev/disk/by-uuid/576088d4-9aae-4159-a028-feadb2621a1a"; + keyFile = "/mnt-root" + toString ./secrets/data_luks_key; + }; + }; }; swapDevices = [