remove reference to /home/colin from modules/persist
This commit is contained in:
parent
77cc560052
commit
ec22c128e0
|
@ -1,18 +1,8 @@
|
|||
{ config, lib, sane-lib, ... }:
|
||||
{ config, ... }:
|
||||
|
||||
let
|
||||
path = sane-lib.path;
|
||||
cfg = config.sane.persist;
|
||||
|
||||
withPrefix = relativeTo: entries: lib.mapAttrs' (fspath: value: {
|
||||
name = path.concat [ relativeTo fspath ];
|
||||
inherit value;
|
||||
}) entries;
|
||||
in
|
||||
{
|
||||
# merge the `byPath` mappings from both `home` and `sys` into one namespace
|
||||
sane.persist.byPath = lib.mkMerge [
|
||||
(withPrefix "/home/colin" cfg.home.byPath)
|
||||
(withPrefix "/" cfg.sys.byPath)
|
||||
];
|
||||
sane.persist.byPath = cfg.sys.byPath;
|
||||
}
|
||||
|
|
|
@ -179,11 +179,6 @@ in
|
|||
type = types.bool;
|
||||
description = "define / fs root to be a tmpfs. make sure to mount some other device to /nix";
|
||||
};
|
||||
sane.persist.home = mkOption {
|
||||
description = "directories to persist to disk, relative to a user's home ~";
|
||||
default = {};
|
||||
type = dirsSubModule;
|
||||
};
|
||||
sane.persist.sys = mkOption {
|
||||
description = "directories to persist to disk, relative to the fs root /";
|
||||
default = {};
|
||||
|
|
|
@ -19,10 +19,10 @@ let
|
|||
};
|
||||
|
||||
persist = mkOption {
|
||||
type = options.sane.persist.home.type;
|
||||
type = options.sane.persist.sys.type;
|
||||
default = {};
|
||||
description = ''
|
||||
entries to pass onto `sane.persist.home`
|
||||
entries to pass onto `sane.persist.sys` after prepending the user's home-dir to the path.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
@ -42,14 +42,20 @@ let
|
|||
# if we're the default user, inherit whatever settings were routed to the default user
|
||||
config = mkIf config.default sane-user-cfg;
|
||||
});
|
||||
processUser = user: defn: {
|
||||
sane.fs = mapAttrs' (path: value: {
|
||||
# TODO: query the user's home dir!
|
||||
name = path-lib.concat [ "/home/${user}" path ];
|
||||
inherit value;
|
||||
}) defn.fs;
|
||||
sane.persist.home = defn.persist;
|
||||
};
|
||||
processUser = user: defn:
|
||||
let
|
||||
prefixWithHome = mapAttrs' (path: value: {
|
||||
# TODO: query the user's home dir!
|
||||
name = path-lib.concat [ "/home/${user}" path ];
|
||||
inherit value;
|
||||
});
|
||||
in
|
||||
{
|
||||
sane.fs = prefixWithHome defn.fs;
|
||||
|
||||
# `byPath` is the actual output here, computed from the other keys.
|
||||
sane.persist.sys.byPath = prefixWithHome defn.persist.byPath;
|
||||
};
|
||||
in
|
||||
{
|
||||
options = {
|
||||
|
@ -78,7 +84,7 @@ in
|
|||
num-default-users = count (u: u.default) (attrValues cfg);
|
||||
take = f: {
|
||||
sane.fs = f.sane.fs;
|
||||
sane.persist = f.sane.persist;
|
||||
sane.persist.sys.byPath = f.sane.persist.sys.byPath;
|
||||
};
|
||||
in mkMerge [
|
||||
(take (sane-lib.mkTypedMerge take configs))
|
||||
|
|
Loading…
Reference in New Issue
Block a user