home-manager/modules/programs/noti.nix

48 lines
910 B
Nix
Raw Normal View History

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