1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-21 17:59:39 +01:00
home-manager/modules/programs/gh-dash.nix
Austin Horstman cba2f9ce95 treewide: reformat nixfmt-rfc-style
Reformat repository using new nixfmt-rfc-style.
2025-04-08 08:50:05 -07:00

47 lines
1 KiB
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.gh-dash;
yamlFormat = pkgs.formats.yaml { };
in
{
meta.maintainers = [ lib.hm.maintainers.janik ];
options.programs.gh-dash = {
enable = lib.mkEnableOption "GitHub CLI dashboard plugin";
package = lib.mkPackageOption pkgs "gh-dash" { nullable = true; };
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 = lib.mkIf (cfg.package != null) [ cfg.package ];
programs.gh.extensions = lib.mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile."gh-dash/config.yml".source = yamlFormat.generate "gh-dash-config.yml" cfg.settings;
};
}