sane.users.<user>.persist: forward to sane.persist.home

This commit is contained in:
Colin 2023-01-30 10:34:36 +00:00
parent 4d3248d315
commit c1f3fc502d
2 changed files with 12 additions and 1 deletions

View File

@ -191,6 +191,7 @@ in
}; };
sane.persist.byPath = mkOption { sane.persist.byPath = mkOption {
type = types.attrsOf (convertInlineAcl entryAtPath); type = types.attrsOf (convertInlineAcl entryAtPath);
# XXX: see computed.nix for definition
description = '' description = ''
map of <path> => <path config> for all paths to be persisted. map of <path> => <path config> for all paths to be persisted.
this is computed from the other options, but users can also set it explicitly (useful for overriding) this is computed from the other options, but users can also set it explicitly (useful for overriding)

View File

@ -1,4 +1,4 @@
{ config, lib, sane-lib, ... }: { config, lib, options, sane-lib, ... }:
let let
inherit (builtins) attrValues; inherit (builtins) attrValues;
@ -17,6 +17,14 @@ let
=> `sane.fs."/home/colin/.config/aerc" = X; => `sane.fs."/home/colin/.config/aerc" = X;
''; '';
}; };
persist = mkOption {
type = options.sane.persist.home.type;
default = {};
description = ''
entries to pass onto `sane.persist.home`
'';
};
}; };
}; };
userModule = types.submodule ({ config, ... }: { userModule = types.submodule ({ config, ... }: {
@ -40,6 +48,7 @@ let
name = path-lib.concat [ "/home/${user}" path ]; name = path-lib.concat [ "/home/${user}" path ];
inherit value; inherit value;
}) defn.fs; }) defn.fs;
sane.persist.home = defn.persist;
}; };
in in
{ {
@ -69,6 +78,7 @@ in
num-default-users = count (u: u.default) (attrValues cfg); num-default-users = count (u: u.default) (attrValues cfg);
take = f: { take = f: {
sane.fs = f.sane.fs; sane.fs = f.sane.fs;
sane.persist = f.sane.persist;
}; };
in mkMerge [ in mkMerge [
(take (sane-lib.mkTypedMerge take configs)) (take (sane-lib.mkTypedMerge take configs))