1
0
Fork 0
mirror of https://github.com/tboerger/nixos-config synced 2024-05-18 10:36:02 +02:00
github.com-tboerger-nixos-c.../home/thomas/programs/github.nix
2024-01-30 14:00:26 +01:00

49 lines
897 B
Nix

{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.profile.programs.github;
in
{
options = {
profile = {
programs = {
github = {
enable = mkEnableOption "GitHub";
};
};
};
};
config = mkIf cfg.enable {
programs = {
gh = {
enable = true;
extensions = with pkgs; [
gh-dash
gh-markdown-preview
gh-poi
];
};
zsh = {
sessionVariables = {
GH_TOKEN = "$(cat ${config.home.homeDirectory}/.ghtoken)";
GITHUB_TOKEN = "$(cat ${config.home.homeDirectory}/.ghtoken)";
};
};
};
homeage = {
file."ghtoken" = {
source = ../secrets/gh.age;
symlinks = [ "${config.home.homeDirectory}/.ghtoken" ];
owner = "thomas";
group = "thomas";
mode = "0600";
};
};
};
}