gh-dash: add module
This commit is contained in:
parent
ab70a02363
commit
a30f5b5b35
|
@ -1152,6 +1152,13 @@ in
|
|||
A new module is available: 'wayland.windowManager.hyprland'
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2023-07-24T10:38:23+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.gh-dash'
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -87,6 +87,7 @@ let
|
|||
./programs/gallery-dl.nix
|
||||
./programs/getmail.nix
|
||||
./programs/gh.nix
|
||||
./programs/gh-dash.nix
|
||||
./programs/git-cliff.nix
|
||||
./programs/git-credential-oauth.nix
|
||||
./programs/git.nix
|
||||
|
|
42
modules/programs/gh-dash.nix
Normal file
42
modules/programs/gh-dash.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.gh-dash;
|
||||
|
||||
yamlFormat = pkgs.formats.yaml { };
|
||||
|
||||
in {
|
||||
meta.maintainers = [ lib.maintainers.janik ];
|
||||
|
||||
options.programs.gh-dash = {
|
||||
enable = lib.mkEnableOption "GitHub CLI dashboard plugin";
|
||||
|
||||
package = lib.mkPackageOption pkgs "gh-dash" { };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = yamlFormat.type;
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
prSections = [{
|
||||
title = "My Pull Requests";
|
||||
filters = "is:open author:@me";
|
||||
}];
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Configuration written to {file}`$XDG_CONFIG_HOME/gh-dash/config.yml`.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
programs.gh.extensions = [ cfg.package ];
|
||||
|
||||
xdg.configFile."gh-dash/config.yml".source =
|
||||
yamlFormat.generate "gh-dash-config.yml" cfg.settings;
|
||||
};
|
||||
}
|
|
@ -77,6 +77,7 @@ import nmt {
|
|||
./modules/programs/fish
|
||||
./modules/programs/gallery-dl
|
||||
./modules/programs/gh
|
||||
./modules/programs/gh-dash
|
||||
./modules/programs/git-cliff
|
||||
./modules/programs/git
|
||||
./modules/programs/gpg
|
||||
|
|
26
tests/modules/programs/gh-dash/config.nix
Normal file
26
tests/modules/programs/gh-dash/config.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
programs.gh-dash = {
|
||||
enable = true;
|
||||
settings = {
|
||||
prSections = [{
|
||||
title = "My Pull Requests";
|
||||
filters = "is:open author:@me";
|
||||
}];
|
||||
};
|
||||
};
|
||||
|
||||
test.stubs.gh = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/gh-dash/config.yml
|
||||
assertFileContent home-files/.config/gh-dash/config.yml ${
|
||||
builtins.toFile "config-file.yml" ''
|
||||
prSections:
|
||||
- filters: is:open author:@me
|
||||
title: My Pull Requests
|
||||
''
|
||||
}
|
||||
'';
|
||||
}
|
1
tests/modules/programs/gh-dash/default.nix
Normal file
1
tests/modules/programs/gh-dash/default.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{ gh-dash-config = ./config.nix; }
|
Loading…
Reference in a new issue