hosts/artemis: fix upgrade
Some checks failed
Check flake / build-amd64-linux (push) Failing after 1m5s
Some checks failed
Check flake / build-amd64-linux (push) Failing after 1m5s
This commit is contained in:
@@ -6,15 +6,8 @@
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
attrNames
|
||||
flip
|
||||
isAttrs
|
||||
mapAttrs
|
||||
mkIf
|
||||
mkMerge
|
||||
mkOption
|
||||
optionals
|
||||
types
|
||||
;
|
||||
in
|
||||
{
|
||||
@@ -88,60 +81,4 @@ in
|
||||
};
|
||||
|
||||
users.mutableUsers = !config.environment.persistence."/persist".enable;
|
||||
|
||||
# For each user that has a home-manager config, merge the locally defined
|
||||
# persistence options that we defined above.
|
||||
imports =
|
||||
let
|
||||
mkUserFiles = map (
|
||||
x: { parentDirectory.mode = "700"; } // (if isAttrs x then x else { file = x; })
|
||||
);
|
||||
mkUserDirs = map (x: { mode = "700"; } // (if isAttrs x then x else { directory = x; }));
|
||||
in
|
||||
[
|
||||
{
|
||||
environment.persistence = mkMerge (
|
||||
flip map (attrNames config.home-manager.users) (
|
||||
user:
|
||||
let
|
||||
hmUserCfg = config.home-manager.users.${user};
|
||||
in
|
||||
flip mapAttrs hmUserCfg.home.persistence (
|
||||
_: sourceCfg: {
|
||||
users.${user} = {
|
||||
files = mkUserFiles sourceCfg.files;
|
||||
directories = mkUserDirs sourceCfg.directories;
|
||||
};
|
||||
}
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
];
|
||||
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
options.home.persistence = mkOption {
|
||||
description = "Additional persistence config for the given source path";
|
||||
default = { };
|
||||
type = types.attrsOf (
|
||||
types.submodule {
|
||||
options = {
|
||||
files = mkOption {
|
||||
description = "Additional files to persist via NixOS impermanence.";
|
||||
type = types.listOf (types.either types.attrs types.str);
|
||||
default = [ ];
|
||||
};
|
||||
|
||||
directories = mkOption {
|
||||
description = "Additional directories to persist via NixOS impermanence.";
|
||||
type = types.listOf (types.either types.attrs types.str);
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user