fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Robert HelgessonMerge PR #421575790441

master
910 B47 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7  cfg = config.programs.noti;
8
9in {
10  meta.maintainers = [ ];
11
12  options.programs.noti = {
13    enable = mkEnableOption "Noti";
14
15    settings = mkOption {
16      type = types.attrsOf (types.attrsOf types.str);
17      default = { };
18      description = ''
19        Configuration written to
20        {file}`$XDG_CONFIG_HOME/noti/noti.yaml`.
21
22        See
23        {manpage}`noti.yaml(5)`.
24        for the full list of options.
25      '';
26      example = literalExpression ''
27        {
28          say = {
29            voice = "Alex";
30          };
31          slack = {
32            token = "1234567890abcdefg";
33            channel = "@jaime";
34          };
35        }
36      '';
37    };
38  };
39
40  config = mkIf cfg.enable {
41    home.packages = [ pkgs.noti ];
42
43    xdg.configFile."noti/noti.yaml" =
44      mkIf (cfg.settings != { }) { text = generators.toYAML { } cfg.settings; };
45  };
46
47}