From 30e47b3e98ac0e427c1b8e7a82489892c2354d85 Mon Sep 17 00:00:00 2001 From: sils Date: Sat, 14 Jan 2023 15:04:00 +0100 Subject: Feat: Switch root into subvolume This enables further changes like temproot. --- hardware-configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hardware-configuration.nix b/hardware-configuration.nix index cb9d265..19626a7 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -6,5 +6,6 @@ fileSystems."/" = { device = "/dev/vda3"; fsType = "btrfs"; + options = ["subvol=nixos-root"]; }; } -- cgit 1.4.1 From 4f0c0ee87c757f74c71c8991c7059c75a48d8523 Mon Sep 17 00:00:00 2001 From: sils Date: Sat, 14 Jan 2023 15:26:17 +0100 Subject: Feat: Separate nix from root Another step towards temproot --- hardware-configuration.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 19626a7..8495607 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -3,9 +3,16 @@ boot.loader.grub.device = "/dev/vda"; boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi"]; boot.initrd.kernelModules = ["nvme" "btrfs"]; - fileSystems."/" = { - device = "/dev/vda3"; - fsType = "btrfs"; - options = ["subvol=nixos-root"]; + fileSystems = { + "/" = { + device = "/dev/vda3"; + fsType = "btrfs"; + options = ["subvol=nixos-root"]; + }; + "/nix" = { + device = "/dev/vda3"; + fsType = "btrfs"; + options = ["subvol=nix"]; + }; }; } -- cgit 1.4.1 From b32d3daea842e32ff44240c0f9fcc8778d1348d6 Mon Sep 17 00:00:00 2001 From: sils Date: Sat, 14 Jan 2023 16:05:45 +0100 Subject: Feat: Switch to inpersistent temproot. Having persistence as opt-in has several advantages, for instance better reproduceability. --- hardware-configuration.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 8495607..d54f90a 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -5,14 +5,23 @@ boot.initrd.kernelModules = ["nvme" "btrfs"]; fileSystems = { "/" = { + device = "tmpfs"; + fsType = "tmpfs"; + options = ["defaults" "size=2G" "mode=755"]; + }; + "/nix" = { device = "/dev/vda3"; fsType = "btrfs"; - options = ["subvol=nixos-root"]; + options = ["subvol=nix" "compress-force=zstd"]; }; - "/nix" = { + "/srv" = { device = "/dev/vda3"; fsType = "btrfs"; - options = ["subvol=nix"]; + options = ["subvol=storage" "compress-force=zstd"]; + }; + "/etc/nixos" = { + device = "/srv/nix-config"; + options = ["bind"]; }; }; } -- cgit 1.4.1