From 3f34bf4465b367c6eb4bc109349e75638e64ae52 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Wed, 19 Sep 2018 09:00:00 -0500 Subject: [PATCH] noti: add module --- modules/misc/news.nix | 7 ++++++ modules/modules.nix | 1 + modules/programs/noti.nix | 53 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 modules/programs/noti.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index b8d4f86b..082f371a 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -793,6 +793,13 @@ in A new module is available: 'programs.zathura'. ''; } + + { + time = "2018-09-20T19:26:40+00:00"; + message = '' + A new module is available: 'programs.noti'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index a7f05eed..889df467 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -48,6 +48,7 @@ let ./programs/msmtp.nix ./programs/neovim.nix ./programs/newsboat.nix + ./programs/noti.nix ./programs/notmuch.nix ./programs/offlineimap.nix ./programs/pidgin.nix diff --git a/modules/programs/noti.nix b/modules/programs/noti.nix new file mode 100644 index 00000000..476c2eb1 --- /dev/null +++ b/modules/programs/noti.nix @@ -0,0 +1,53 @@ +{ config, lib, pkgs, ...}: + +with lib; + +let + + cfg = config.programs.noti; + +in + +{ + meta.maintainers = [ maintainers.marsam ]; + + options.programs.noti = { + enable = mkEnableOption "Noti"; + + settings = mkOption { + type = types.attrsOf (types.attrsOf types.str); + default = {}; + description = '' + Configuration written to + ~/.config/noti/noti.yaml. + + See + + noti.yaml + 5 + . + for the full list of options. + ''; + example = literalExample '' + { + 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; + }; + }; + +}