about summary refs log tree commit diff
path: root/hosts/phobos/hardware.nix
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2022-08-06 12:02:36 +0200
committerBaitinq <manuelpalenzuelamerino@gmail.com>2022-08-06 12:05:29 +0200
commitd4bf84aa8d41f1bc12bdc49c10a0afdfb87f9f07 (patch)
treed2946c34af9dc90e0d6b34a72f7803dbe5050b99 /hosts/phobos/hardware.nix
parentFirefox: Remove bypass-paywalls extension (diff)
downloadnixos-config-d4bf84aa8d41f1bc12bdc49c10a0afdfb87f9f07.tar.gz
nixos-config-d4bf84aa8d41f1bc12bdc49c10a0afdfb87f9f07.tar.bz2
nixos-config-d4bf84aa8d41f1bc12bdc49c10a0afdfb87f9f07.zip
Phobos: Change filesystem to be encrypted+stateless
Diffstat (limited to '')
-rw-r--r--hosts/phobos/hardware.nix26
1 files changed, 17 insertions, 9 deletions
diff --git a/hosts/phobos/hardware.nix b/hosts/phobos/hardware.nix
index 4833668..478449b 100644
--- a/hosts/phobos/hardware.nix
+++ b/hosts/phobos/hardware.nix
@@ -15,29 +15,37 @@ in
     kernelParams = [ "net.ifnames=0" "biosdevname=0" "iomem=relaxed" "mitigations=off" ];
   };
 
+  fileSystems."/" = {
+    device = "none";
+    fsType = "tmpfs";
+  };
+
   fileSystems."/boot" = {
     device = "/dev/disk/by-uuid/0A8B-3968";
     fsType = "vfat";
   };
 
-  fileSystems."/" = {
-    device = "/dev/disk/by-uuid/9a450653-8369-4850-af4f-cbec7cac8a99";
-    fsType = "btrfs";
-    options = [ "subvol=root" "compress-force=zstd" "noatime" ];
-  };
+  boot.initrd.luks.devices."encrypted_root".device = "/dev/disk/by-uuid/095dc267-9281-4535-9491-b3fcded614a8";
 
-  fileSystems."/home" = {
-    device = "/dev/disk/by-uuid/9a450653-8369-4850-af4f-cbec7cac8a99";
+  fileSystems."/persist" = {
+    device = "/dev/mapper/encrypted_root";
     fsType = "btrfs";
-    options = [ "subvol=home" "compress-force=zstd" ];
+    neededForBoot = true;
+    options = [ "subvol=persist" "compress-force=zstd" "noatime" ];
   };
 
   fileSystems."/nix" = {
-    device = "/dev/disk/by-uuid/9a450653-8369-4850-af4f-cbec7cac8a99";
+    device = "/dev/mapper/encrypted_root";
     fsType = "btrfs";
     options = [ "subvol=nix" "compress-force=zstd" "noatime" ];
   };
 
+  fileSystems."/home" = {
+    device = "/dev/mapper/encrypted_root";
+    fsType = "btrfs";
+    options = [ "subvol=home" "compress-force=zstd" ];
+  };
+
   swapDevices = [ ];
 
   powerManagement.cpuFreqGovernor = powerMode;