summaryrefslogtreecommitdiffstats
path: root/system/file_system_layouts
diff options
context:
space:
mode:
Diffstat (limited to 'system/file_system_layouts')
-rw-r--r--system/file_system_layouts/default.nix15
-rw-r--r--system/file_system_layouts/impermanence.nix16
2 files changed, 21 insertions, 10 deletions
diff --git a/system/file_system_layouts/default.nix b/system/file_system_layouts/default.nix
index fe7fc3f..d038632 100644
--- a/system/file_system_layouts/default.nix
+++ b/system/file_system_layouts/default.nix
@@ -1,5 +1,4 @@
{
- modulesPath,
config,
lib,
...
@@ -7,6 +6,10 @@
with lib; let
cfg = config.system.fileSystemLayouts;
in {
+ imports = [
+ ./impermanence.nix
+ ];
+
options.system.fileSystemLayouts = {
mainDisk = mkOption {
type = lib.types.path;
@@ -30,20 +33,12 @@ in {
device = cfg.mainDisk;
fsType = "btrfs";
options = ["subvol=storage" "compress-force=zstd"];
+ neededForBoot = true;
};
"/boot" = {
device = cfg.mainDisk;
options = ["subvol=boot" "compress-force=zstd"];
};
-
- "/etc/nixos" = {
- device = "/srv/nix-config";
- options = ["bind"];
- };
- "/var/lib/postgresql" = {
- device = "/srv/postgresql";
- options = ["bind"];
- };
};
};
}
diff --git a/system/file_system_layouts/impermanence.nix b/system/file_system_layouts/impermanence.nix
new file mode 100644
index 0000000..da38791
--- /dev/null
+++ b/system/file_system_layouts/impermanence.nix
@@ -0,0 +1,16 @@
+{...}: {
+ environment.persistence = {
+ "/srv" = {
+ hideMounts = true;
+ directories = [
+ "/etc/nixos"
+ "/var/log"
+ "/var/lib/postgresql"
+ "/var/lib/acme"
+ ];
+ files = [
+ "/etc/machine-id"
+ ];
+ };
+ };
+}