From 6b09d4c53651b5c63003fb989da0e4af1be06f70 Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Thu, 27 Apr 2023 14:59:47 +0200 Subject: [PATCH] feat: moved capibara's root to a different disk --- capibara.nix | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/capibara.nix b/capibara.nix index 6b9acb9..8faf2af 100644 --- a/capibara.nix +++ b/capibara.nix @@ -39,8 +39,14 @@ in { options = [ "subvolid=5" "compress=zstd" ]; }; + "/mnt/btr_data" = { + device = "/dev/mapper/data"; + fsType = "btrfs"; + options = [ "subvolid=5" "compress=zstd" ]; + }; + "/mnt/persist" = { - device = "/dev/mapper/root"; + device = "/dev/mapper/data"; fsType = "btrfs"; options = [ "subvol=persist" "compress=zstd" ]; neededForBoot = true; @@ -54,7 +60,7 @@ in { }; "/mnt/data" = { - device = "/dev/mapper/root"; + device = "/dev/mapper/data"; fsType = "btrfs"; options = [ "subvol=data" "compress=zstd" ]; neededForBoot = true; @@ -67,9 +73,8 @@ in { }; "/boot" = { - device = "/dev/mapper/root"; - fsType = "btrfs"; - options = [ "subvol=boot" "compress=zstd" ]; + device = "/dev/disk/by-uuid/c99d1f1b-45a4-4a25-b5b8-bc76464c6825"; + fsType = "ext4"; }; "/swap" = { @@ -79,7 +84,7 @@ in { }; "/mnt/vfs_share" = { - device = "/dev/mapper/root"; + device = "/dev/mapper/data"; fsType = "btrfs"; options = [ "subvol=vfs_share" "compress=zstd" ]; }; @@ -137,21 +142,23 @@ in { efiInstallAsRemovable = false; enable = true; version = 2; - # device = "/dev/disk/by-id/ata-KINGSTON_SKC600MS512G_50026B7783FC3D2F"; - device = "/dev/disk/by-id/ata-WDC_WDBNCE0010PNC_21112S803178"; - enableCryptodisk = true; + device = "/dev/disk/by-id/ata-KINGSTON_SKC600MS512G_50026B7783FC3D2F"; }; }; initrd = { - luks.devices = { - root = { - device = "/dev/disk/by-uuid/0fdb839e-dee8-4374-81e6-4455cfc3ae39"; - keyFile = "/keyfile.bin"; - allowDiscards = true; + luks = { + devices = { + root = { + device = "/dev/disk/by-uuid/869b4b9e-5004-4625-877f-6b1c9489ac8f"; + allowDiscards = true; + }; + data = { + device = "/dev/disk/by-uuid/0fdb839e-dee8-4374-81e6-4455cfc3ae39"; + allowDiscards = true; + }; }; + reusePassphrases = true; }; - # secrets = { "/keyfile.bin" = "/boot/keyfile.bin"; }; - secrets = { "/keyfile.bin" = "/etc/luks-keys/root.bin"; }; }; };