depot/third_party/home-manager/modules/programs/noti.nix
Default email 75fa0ae5af Project import generated by Copybara.
GitOrigin-RevId: c3ab5ea047e6dc73df530948f7367455749d8906
2023-08-08 12:19:01 +02:00

47 lines
910 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.noti;
in {
meta.maintainers = [ ];
options.programs.noti = {
enable = mkEnableOption "Noti";
settings = mkOption {
type = types.attrsOf (types.attrsOf types.str);
default = { };
description = ''
Configuration written to
{file}`$XDG_CONFIG_HOME/noti/noti.yaml`.
See
{manpage}`noti.yaml(5)`.
for the full list of options.
'';
example = literalExpression ''
{
say = {
voice = "Alex";
};
slack = {
token = "1234567890abcdefg";
channel = "@jaime";
};
}
'';
};
};
config = mkIf cfg.enable {
home.packages = [ pkgs.noti ];
xdg.configFile."noti/noti.yaml" =
mkIf (cfg.settings != { }) { text = generators.toYAML { } cfg.settings; };
};
}