fix: fixed file system resolution

This commit is contained in:
Leyla Becker 2025-11-23 11:51:53 -06:00
parent 5dc602339c
commit 2922114367
5 changed files with 36 additions and 74 deletions

View file

@ -42,15 +42,9 @@ in {
# Create ZFS datasets based on storage.datasets configuration
storage.datasets = {
local = {
"" = {
type = "zfs_fs";
};
"nix" = {
type = "zfs_fs";
mount = {
enable = true;
mountPoint = "/nix";
};
mount = "/nix";
snapshot = {
autoSnapshot = false;
};
@ -59,15 +53,9 @@ in {
};
};
replicate = {
"" = {
type = "zfs_fs";
};
"system/var/log" = {
type = "zfs_fs";
mount = {
enable = true;
mountPoint = "/var/log";
};
mount = "/var/log";
};
};
};
@ -77,24 +65,29 @@ in {
ephemeral = {
"" = {
type = "zfs_fs";
mount = null;
};
"system/root" = {
type = "zfs_fs";
mount = {
enable = true;
mountPoint = "/";
};
mount = "/";
snapshot = {
blankSnapshot = true;
};
};
};
# TODO: can we auto set the mount points on these to just be `"/persist/local/${name}"`
local = {
"" = {
mount = "/persist/local/";
};
};
# TODO: can we auto set the mount points on these to just be `"/persist/replicate/${name}"`
replicate = {
"" = {
mount = "/persist/replicate/";
};
"system/root" = {
mount = {
enable = true;
mountPoint = "/persist/replicate/system/root";
};
mount = "/persist/replicate/system/root";
snapshot = {
autoSnapshot = true;
};
@ -107,10 +100,7 @@ in {
};
};
"home" = {
mount = {
enable = true;
mountPoint = "/persist/replicate/home";
};
mount = "/persist/replicate/home";
snapshot = {
autoSnapshot = true;
};
@ -156,12 +146,13 @@ in {
storage.datasets = {
# Base organizational datasets (only needed when impermanence is disabled)
local = {
"" = {
type = "zfs_fs";
mount = "";
};
"root" = {
type = "zfs_fs";
mount = {
enable = true;
mountPoint = "/";
};
mount = "/";
compression = "lz4";
acltype = "posixacl";
relatime = "on";
@ -171,26 +162,15 @@ in {
blankSnapshot = true;
};
};
"nix" = {
type = "zfs_fs";
mount = {
enable = true;
mountPoint = "/nix";
};
snapshot = {
autoSnapshot = false;
};
atime = "off";
relatime = "off";
};
};
replicate = {
"" = {
type = "zfs_fs";
mount = null;
};
"system/var/log" = {
type = "zfs_fs";
mount = {
enable = true;
mountPoint = "/var/log";
};
mount = "/var/log";
};
};
};

View file

@ -42,16 +42,10 @@
description = "Synchronous write behavior";
};
mount = {
enable = lib.mkOption {
type = lib.types.either lib.types.bool (lib.types.enum ["on" "off" "noauto"]);
default = true;
description = "Whether and how the dataset should be mounted";
};
mountPoint = lib.mkOption {
type = lib.types.str;
description = "Controls the mount point used for this file system";
};
mount = lib.mkOption {
type = lib.types.nullOr lib.types.str;
description = "Controls the mount point used for this file system";
default = null;
};
encryption = {

View file

@ -47,9 +47,6 @@ in {
};
config = {
mount = {
mountPoint = lib.mkDefault "/${name}";
enable = lib.mkDefault true;
};
mount = lib.mkDefault "/${name}";
};
}

View file

@ -83,7 +83,7 @@ args @ {
lib.attrsets.nameValuePair name {
type = dataset.type;
options = datasetToZfsOptions dataset;
mountpoint = dataset.mount.mountPoint or null;
mountpoint = dataset.mount or null;
postCreateHook = generatePostCreateHook name dataset;
}
)
@ -92,7 +92,7 @@ args @ {
lib.attrsets.nameValuePair "" {
type = config.storage.zfs.rootDataset.type;
options = datasetToZfsOptions config.storage.zfs.rootDataset;
mountpoint = config.storage.zfs.rootDataset.mount.mountPoint or null;
mountpoint = config.storage.zfs.rootDataset.mount or null;
postCreateHook = generatePostCreateHook "" config.storage.zfs.rootDataset;
}
))