feat: made datasets build
This commit is contained in:
parent
61eef3067e
commit
8aa984a389
4 changed files with 32 additions and 24 deletions
|
|
@ -80,6 +80,15 @@ in {
|
|||
|
||||
programs.fuse.userAllowOther = true;
|
||||
|
||||
fileSystems =
|
||||
lib.mapAttrs' (
|
||||
datasetName: dataset:
|
||||
lib.nameValuePair "/${datasetName}" {
|
||||
neededForBoot = true;
|
||||
}
|
||||
)
|
||||
config.storage.impermanence.datasets;
|
||||
|
||||
environment.persistence =
|
||||
lib.mapAttrs (datasetName: dataset: {
|
||||
enable = true;
|
||||
|
|
@ -101,7 +110,6 @@ in {
|
|||
}) (lib.filterAttrs (_: fileConfig: fileConfig.enable) dataset.files);
|
||||
})
|
||||
config.storage.impermanence.datasets;
|
||||
# TODO: need for boot on filesystems
|
||||
}
|
||||
(lib.mkIf config.storage.zfs.enable {
|
||||
storage.zfs.datasets =
|
||||
|
|
|
|||
|
|
@ -35,17 +35,19 @@
|
|||
};
|
||||
}
|
||||
(lib.mkIf (!config.storage.impermanence.enable) {
|
||||
# TODO: create datasets for systemd.services.<name>.storage.impermanence.datasets
|
||||
storage.zfs.datasets = {
|
||||
"persist/system/root" = {
|
||||
storage.zfs.rootDataset = {
|
||||
type = "zfs_fs";
|
||||
mount = {
|
||||
enable = false;
|
||||
enable = true;
|
||||
mountPoint = "/";
|
||||
};
|
||||
compression = "lz4";
|
||||
acltype = "posixacl";
|
||||
relatime = "on";
|
||||
xattr = "sa";
|
||||
snapshot = {
|
||||
autoSnapshot = true;
|
||||
};
|
||||
blankSnapshot = true;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
|
@ -70,8 +72,8 @@
|
|||
storage.impermanence.datasets = {
|
||||
"persist/system/root" = {
|
||||
mount = {
|
||||
enable = false;
|
||||
mountPoint = "/";
|
||||
enable = true;
|
||||
mountPoint = "/persist/system/root";
|
||||
};
|
||||
directories = {
|
||||
"/var/lib/nixos".enable = true;
|
||||
|
|
@ -81,6 +83,12 @@
|
|||
"/etc/machine-id".enable = true;
|
||||
};
|
||||
};
|
||||
"persist/home" = {
|
||||
mount = {
|
||||
enable = true;
|
||||
mountPoint = "/persist/home";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# TODO: home-manager.users.<user>.storage.impermanence.enable
|
||||
|
|
|
|||
|
|
@ -14,14 +14,14 @@ args @ {lib, ...}: {name, ...}: let
|
|||
owner = {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "nouser";
|
||||
default = "root";
|
||||
};
|
||||
permissions = pathPermissions;
|
||||
};
|
||||
group = {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "nogroup";
|
||||
default = "root";
|
||||
};
|
||||
permissions = pathPermissions;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -415,7 +415,6 @@ in {
|
|||
relatime = "off";
|
||||
};
|
||||
}
|
||||
# Create ZFS datasets for each normal user
|
||||
(lib.mkMerge (
|
||||
builtins.map (user: {
|
||||
"local/home/${user.name}" = {
|
||||
|
|
@ -426,13 +425,6 @@ in {
|
|||
};
|
||||
snapshot.blankSnapshot = true;
|
||||
};
|
||||
"persist/home/${user.name}" = {
|
||||
type = "zfs_fs";
|
||||
mount = {
|
||||
enable = true;
|
||||
mountPoint = "/persist/home/${user.name}";
|
||||
};
|
||||
};
|
||||
})
|
||||
normalUsers
|
||||
))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue