depot/modules/systemd-extras/chant.nix

20 lines
489 B
Nix
Raw Permalink Normal View History

2024-07-10 15:00:00 +03:00
{ 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";
};
}));
};
}