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" ''
|
||||
export PATH='${makeBinPath ([ coreutils ] ++ extraPackages)}'
|
||||
${script}
|
||||
|
@ -53,14 +53,24 @@ let
|
|||
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;
|
||||
in
|
||||
|
||||
{
|
||||
options.system.ascensions = mkOption {
|
||||
options.system = {
|
||||
ascensions = mkOption {
|
||||
type = with types; attrsOf (submodule ascensionType);
|
||||
default = {};
|
||||
};
|
||||
extraIncantations = mkOption {
|
||||
type = with types; attrsOf (functionTo raw);
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
systemd = {
|
||||
|
|
Loading…
Reference in a new issue