fix: fixed file system resolution
This commit is contained in:
parent
5dc602339c
commit
2922114367
5 changed files with 36 additions and 74 deletions
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -47,9 +47,6 @@ in {
|
|||
};
|
||||
|
||||
config = {
|
||||
mount = {
|
||||
mountPoint = lib.mkDefault "/${name}";
|
||||
enable = lib.mkDefault true;
|
||||
};
|
||||
mount = lib.mkDefault "/${name}";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
))
|
||||
|
|
|
|||
|
|
@ -404,10 +404,7 @@ in {
|
|||
# sops age key needs to be available to pre persist for user generation
|
||||
storage.datasets.local."system/sops" = {
|
||||
type = "zfs_fs";
|
||||
mount = {
|
||||
enable = true;
|
||||
mountPoint = SOPS_AGE_KEY_DIRECTORY;
|
||||
};
|
||||
mount = SOPS_AGE_KEY_DIRECTORY;
|
||||
atime = "off";
|
||||
relatime = "off";
|
||||
};
|
||||
|
|
@ -417,10 +414,7 @@ in {
|
|||
builtins.map (user: {
|
||||
"home/${user.name}" = {
|
||||
type = "zfs_fs";
|
||||
mount = {
|
||||
enable = true;
|
||||
mountPoint = "/home/${user.name}";
|
||||
};
|
||||
mount = "/home/${user.name}";
|
||||
snapshot.autoSnapshot = true;
|
||||
};
|
||||
})
|
||||
|
|
@ -432,10 +426,7 @@ in {
|
|||
builtins.map (user: {
|
||||
"home/${user.name}" = {
|
||||
type = "zfs_fs";
|
||||
mount = {
|
||||
enable = true;
|
||||
mountPoint = "/home/${user.name}";
|
||||
};
|
||||
mount = "/home/${user.name}";
|
||||
snapshot.blankSnapshot = true;
|
||||
};
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue