From 4f22ad7e5105a8276f9e0a89cfbced969e811f05 Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Wed, 21 Feb 2024 10:23:51 +0100 Subject: [PATCH] Remove the old disk layout for EDI --- disko/EDI/default.nix | 44 +++++++++++++------ disko/EDI/lvm.nix | 71 ------------------------------- nixos/hosts/EDI/configuration.nix | 2 +- 3 files changed, 32 insertions(+), 85 deletions(-) delete mode 100644 disko/EDI/lvm.nix diff --git a/disko/EDI/default.nix b/disko/EDI/default.nix index 30d9181..f8cd5dc 100644 --- a/disko/EDI/default.nix +++ b/disko/EDI/default.nix @@ -19,29 +19,22 @@ ]; }; }; - encryptedSwap = { - size = "4G"; - content = { - type = "swap"; - randomEncryption = true; - }; - }; luks = { size = "100%"; content = { type = "luks"; name = "crypted"; - # disable settings.keyFile if you want to use interactive password entry - #passwordFile = "/tmp/secret.key"; # Interactive + extraOpenArgs = []; settings = { - allowDiscards = true; + # if you want to use the key for interactive login be sure there is no trailing newline + # for example use `echo -n "password" > /tmp/secret.key` #keyFile = "/tmp/secret.key"; + allowDiscards = true; }; #additionalKeyFiles = ["/tmp/additionalSecret.key"]; content = { - type = "filesystem"; - format = "bcachefs"; - mountpoint = "/"; + type = "lvm_pv"; + vg = "pool"; }; }; }; @@ -49,5 +42,30 @@ }; }; }; + lvm_vg = { + pool = { + type = "lvm_vg"; + lvs = { + swap = { + size = "8G"; + content = { + type = "swap"; + resumeDevice = true; # resume from hiberation from this device + }; + }; + root = { + size = "100%FREE"; + content = { + type = "filesystem"; + format = "bcachefs"; + mountpoint = "/"; + mountOptions = [ + "defaults" + ]; + }; + }; + }; + }; + }; }; } diff --git a/disko/EDI/lvm.nix b/disko/EDI/lvm.nix deleted file mode 100644 index f8cd5dc..0000000 --- a/disko/EDI/lvm.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ - disko.devices = { - disk = { - nvme0n1 = { - type = "disk"; - device = "/dev/disk/by-path/pci-0000:71:00.0-nvme-1"; - content = { - type = "gpt"; - partitions = { - ESP = { - size = "512M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ - "defaults" - ]; - }; - }; - luks = { - size = "100%"; - content = { - type = "luks"; - name = "crypted"; - extraOpenArgs = []; - settings = { - # if you want to use the key for interactive login be sure there is no trailing newline - # for example use `echo -n "password" > /tmp/secret.key` - #keyFile = "/tmp/secret.key"; - allowDiscards = true; - }; - #additionalKeyFiles = ["/tmp/additionalSecret.key"]; - content = { - type = "lvm_pv"; - vg = "pool"; - }; - }; - }; - }; - }; - }; - }; - lvm_vg = { - pool = { - type = "lvm_vg"; - lvs = { - swap = { - size = "8G"; - content = { - type = "swap"; - resumeDevice = true; # resume from hiberation from this device - }; - }; - root = { - size = "100%FREE"; - content = { - type = "filesystem"; - format = "bcachefs"; - mountpoint = "/"; - mountOptions = [ - "defaults" - ]; - }; - }; - }; - }; - }; - }; -} diff --git a/nixos/hosts/EDI/configuration.nix b/nixos/hosts/EDI/configuration.nix index 70d0c8b..aa96251 100644 --- a/nixos/hosts/EDI/configuration.nix +++ b/nixos/hosts/EDI/configuration.nix @@ -24,7 +24,7 @@ ../../desktop - ../../../disko/EDI/lvm.nix + ../../../disko/EDI # Import your generated (nixos-generate-config) hardware configuration ./hardware-configuration.nix