refactor: sane.programs.$foo.service: specify type concretely
This commit is contained in:
@@ -216,7 +216,7 @@ let
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
services = mkOption {
|
services = mkOption {
|
||||||
type = types.attrsOf types.anything; # options.sane.users.value.type;
|
type = options.sane.user._options.services.type;
|
||||||
default = {};
|
default = {};
|
||||||
description = ''
|
description = ''
|
||||||
user services to define if this package is enabled.
|
user services to define if this package is enabled.
|
||||||
|
@@ -108,8 +108,7 @@ let
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
userOptions = {
|
userOptions = with lib; {
|
||||||
options = with lib; {
|
|
||||||
fs = mkOption {
|
fs = mkOption {
|
||||||
# map to listOf attrs so that we can allow multiple assigners to the same path
|
# map to listOf attrs so that we can allow multiple assigners to the same path
|
||||||
# w/o worrying about merging at this layer, and defer merging to modules/fs instead.
|
# w/o worrying about merging at this layer, and defer merging to modules/fs instead.
|
||||||
@@ -155,11 +154,10 @@ let
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
userModule = let
|
userModule = let
|
||||||
nixConfig = config;
|
nixConfig = config;
|
||||||
in with lib; types.submodule ({ name, config, ... }: {
|
in with lib; types.submodule ({ name, config, ... }: {
|
||||||
options = userOptions.options // {
|
options = userOptions// {
|
||||||
default = mkOption {
|
default = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
@@ -335,11 +333,13 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
sane.user = mkOption {
|
sane.user = mkOption {
|
||||||
type = types.nullOr (types.submodule userOptions);
|
type = types.nullOr (types.submodule { options = userOptions; });
|
||||||
default = null;
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
options to pass down to the default user
|
options to pass down to the default user
|
||||||
'';
|
'';
|
||||||
|
} // {
|
||||||
|
_options = userOptions;
|
||||||
};
|
};
|
||||||
|
|
||||||
sane.defaultUser = mkOption {
|
sane.defaultUser = mkOption {
|
||||||
|
Reference in New Issue
Block a user