persist: auto-map user-provided store values earlier
This commit is contained in:
parent
841a2a3bcb
commit
4520e1d1f5
|
@ -12,7 +12,7 @@ let
|
||||||
|
|
||||||
# set the `store` attribute on one dir attrset
|
# set the `store` attribute on one dir attrset
|
||||||
fixStore = store: dir: dir // {
|
fixStore = store: dir: dir // {
|
||||||
store = cfg.stores."${store}";
|
inherit store;
|
||||||
};
|
};
|
||||||
# String -> [a] -> [a]
|
# String -> [a] -> [a]
|
||||||
# usually called on an attrset to map (AttrSet [a]) -> [a]
|
# usually called on an attrset to map (AttrSet [a]) -> [a]
|
||||||
|
|
|
@ -52,6 +52,8 @@ let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
coercedToStore = types.coercedTo types.str (s: cfg.stores."${s}") storeType;
|
||||||
|
|
||||||
# options for a single mountpoint / persistence
|
# options for a single mountpoint / persistence
|
||||||
dirEntryOptions = {
|
dirEntryOptions = {
|
||||||
options = {
|
options = {
|
||||||
|
@ -75,7 +77,7 @@ let
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
store = mkOption {
|
store = mkOption {
|
||||||
type = storeType;
|
type = coercedToStore;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -85,7 +87,7 @@ let
|
||||||
options = {
|
options = {
|
||||||
inherit (sane-types.aclOverrideMod.options) user group mode;
|
inherit (sane-types.aclOverrideMod.options) user group mode;
|
||||||
store = mkOption {
|
store = mkOption {
|
||||||
type = storeType;
|
type = coercedToStore;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user