move git to own mod

This commit is contained in:
müde 2026-05-01 23:43:24 +02:00
parent 29ab335879
commit c2aa932494
5 changed files with 32 additions and 17 deletions

View file

@ -9,6 +9,7 @@
./en-de.nix
./extra-caches.nix
./firmware-updates.nix
./git.nix
./globalinstalls.nix
./gnome.nix
./intel-graphics.nix

24
nixosModules/git.nix Normal file
View file

@ -0,0 +1,24 @@
{
lib,
config,
pkgs,
...
}:
{
options.my.git.enable = lib.mkEnableOption "git with credential helper";
config = lib.mkIf config.my.git.enable {
environment.systemPackages = [ pkgs.git-credential-oauth ];
programs.git = {
enable = true;
config = {
init.defaultBranch = "main";
credential = {
helper = "oauth";
credentialStore = "cache";
};
};
};
};
}

View file

@ -16,24 +16,16 @@
screen
tldr
nix-output-monitor
git-credential-oauth
];
programs = {
zsh.enable = true;
htop.enable = true;
iotop.enable = true;
git.enable = true;
nano = {
enable = true;
syntaxHighlight = true;
};
};
environment.etc."gitconfig".text = ''
[credential]
helper = oauth
credentialStore = cache
'';
};
}