modules/ascensions: allow specifying custom incantations
This commit is contained in:
parent
72f3cead67
commit
d51e5e4847
1 changed files with 14 additions and 4 deletions
|
@ -34,7 +34,7 @@ let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
runIncantations = f: with pkgs; f rec {
|
builtinIncantations = with pkgs; rec {
|
||||||
execShellWith = extraPackages: script: writeShellScript "incantation" ''
|
execShellWith = extraPackages: script: writeShellScript "incantation" ''
|
||||||
export PATH='${makeBinPath ([ coreutils ] ++ extraPackages)}'
|
export PATH='${makeBinPath ([ coreutils ] ++ extraPackages)}'
|
||||||
${script}
|
${script}
|
||||||
|
@ -53,14 +53,24 @@ let
|
||||||
chmod = mode: target: "chmod -R ${escapeShellArgs [ mode target ]}";
|
chmod = mode: target: "chmod -R ${escapeShellArgs [ mode target ]}";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
allIncantations = builtinIncantations // mapAttrs (_: mk: mk allIncantations) config.system.extraIncantations;
|
||||||
|
|
||||||
|
runIncantations = f: f allIncantations;
|
||||||
|
|
||||||
consul = config.services.consul.package;
|
consul = config.services.consul.package;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
options.system.ascensions = mkOption {
|
options.system = {
|
||||||
|
ascensions = mkOption {
|
||||||
type = with types; attrsOf (submodule ascensionType);
|
type = with types; attrsOf (submodule ascensionType);
|
||||||
default = {};
|
default = {};
|
||||||
};
|
};
|
||||||
|
extraIncantations = mkOption {
|
||||||
|
type = with types; attrsOf (functionTo raw);
|
||||||
|
default = {};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
systemd = {
|
systemd = {
|
||||||
|
|
Loading…
Reference in a new issue