feat(nixos): configure global git settings for systemd

Add environment variables to set global, system, and default git configurations in the nixos-upgrade service. This change ensures that the service uses a consistent git configuration regardless of user-specific settings.
This commit is contained in:
Harald Hoyer 2024-11-29 15:33:36 +01:00
parent afc947f86f
commit 7a8aebc070

View file

@ -159,8 +159,12 @@ in
]; ];
flake = lib.mkDefault "git+https://git.hoyer.xyz/harald/nixcfg"; flake = lib.mkDefault "git+https://git.hoyer.xyz/harald/nixcfg";
}; };
systemd.services.nixos-upgrade = { systemd.services.nixos-upgrade = {
path = [ pkgs.metacfg.rot8000 ]; path = [ pkgs.metacfg.rot8000 ];
environment.GIT_CONFIG_GLOBAL = "${config.environment.etc.gitconfig.source}";
environment.GIT_CONFIG_SYSTEM = "${config.environment.etc.gitconfig.source}";
environment.GIT_CONFIG = "${config.environment.etc.gitconfig.source}";
}; };
programs.git.enable = true; programs.git.enable = true;