Commit 35101c4c42e2
Changed files (2)
home
common
shell
modules
home/common/shell/gh.nix
@@ -7,7 +7,8 @@
gh-f
gh-poi
gh-s
- gh-news
+ # gh-news is installed separately with a wrapper that sets GH_TOKEN
+ # (see home/common/dev/gh-news.nix and home/modules/gh-news.nix)
];
settings = {
git_protocol = "ssh";
home/modules/gh-news.nix
@@ -52,7 +52,13 @@ in
};
config = lib.mkIf cfg.enable {
- home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
+ home.packages = lib.mkIf (cfg.package != null) [
+ # Wrap gh-news to automatically set GH_TOKEN from gh auth
+ (pkgs.writeShellScriptBin "gh-news" ''
+ export GH_TOKEN="$(${pkgs.gh}/bin/gh auth token)"
+ exec ${cfg.package}/bin/gh-news "$@"
+ '')
+ ];
xdg.configFile."gh-news/config.toml" = lib.mkIf (finalSettings != { }) {
source = tomlFormat.generate "gh-news-config" finalSettings;