47 lines
1 KiB
Nix
47 lines
1 KiB
Nix
{
|
|
name,
|
|
lib,
|
|
config,
|
|
...
|
|
}:
|
|
let
|
|
inherit (lib.modules)
|
|
mkIf
|
|
;
|
|
inherit (lib.options)
|
|
mkOption
|
|
mkEnableOption
|
|
literalExpression
|
|
;
|
|
t = lib.types;
|
|
|
|
/** Either a list of strings, or a dotted string that will be split. */
|
|
convenientAttrPath = t.coercedTo t.str (lib.splitString ".") (t.listOf t.str);
|
|
in
|
|
{
|
|
options = {
|
|
enable = mkEnableOption "dynamicism for '${name}'";
|
|
|
|
source-options = mkOption {
|
|
type = t.listOf convenientAttrPath;
|
|
description = "A list of attrpaths of the NixOS option the dynamicism for '${name}' uses";
|
|
example = literalExpression ''
|
|
[ [ "services" "gotosocial" "settings" ] "services.nginx.settings" ]
|
|
'';
|
|
};
|
|
|
|
systemd-services-updated = mkOption {
|
|
type = t.listOf t.str;
|
|
description = ''
|
|
A list of systemd unit names (including the suffix, e.g. `.service`) that need to be updated.
|
|
'';
|
|
example = literalExpression ''
|
|
"gotosocial.service"
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = mkIf config.enable {
|
|
|
|
};
|
|
}
|