fork/home-manager

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

Janik Hgh-dash: add modulea30f5b5b

master
946 B42 linesraw
1{ config, lib, pkgs, ... }:
2
3let
4
5  cfg = config.programs.gh-dash;
6
7  yamlFormat = pkgs.formats.yaml { };
8
9in {
10  meta.maintainers = [ lib.maintainers.janik ];
11
12  options.programs.gh-dash = {
13    enable = lib.mkEnableOption "GitHub CLI dashboard plugin";
14
15    package = lib.mkPackageOption pkgs "gh-dash" { };
16
17    settings = lib.mkOption {
18      type = yamlFormat.type;
19      default = { };
20      example = lib.literalExpression ''
21        {
22          prSections = [{
23            title = "My Pull Requests";
24            filters = "is:open author:@me";
25          }];
26        }
27      '';
28      description = ''
29        Configuration written to {file}`$XDG_CONFIG_HOME/gh-dash/config.yml`.
30      '';
31    };
32  };
33
34  config = lib.mkIf cfg.enable {
35    home.packages = [ cfg.package ];
36
37    programs.gh.extensions = [ cfg.package ];
38
39    xdg.configFile."gh-dash/config.yml".source =
40      yamlFormat.generate "gh-dash-config.yml" cfg.settings;
41  };
42}