modules/systemd-extras: support chants
This commit is contained in:
parent
bffd063523
commit
5f3661d06a
2 changed files with 20 additions and 0 deletions
19
modules/systemd-extras/chant.nix
Normal file
19
modules/systemd-extras/chant.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ lib, ... }:
|
||||
|
||||
with lib;
|
||||
{
|
||||
options.systemd.services = mkOption {
|
||||
type = with types; attrsOf (submodule ({ config, name, ... }: {
|
||||
options.chant = {
|
||||
enable = mkEnableOption "listening for a waking chant";
|
||||
};
|
||||
config = lib.mkIf config.chant.enable {
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
LoadCredential = [ "chantPayload:/run/chant/${name}" ];
|
||||
};
|
||||
environment.CHANT_PAYLOAD = "%d/chantPayload";
|
||||
};
|
||||
}));
|
||||
};
|
||||
}
|
|
@ -2,5 +2,6 @@
|
|||
imports = [
|
||||
./strict-mounts.nix
|
||||
./distributed.nix
|
||||
./chant.nix
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue