From 7a8aebc0701af4e0587432469eb0d719f30dea21 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 29 Nov 2024 15:33:36 +0100 Subject: [PATCH] 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. --- modules/nixos/services/base/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/nixos/services/base/default.nix b/modules/nixos/services/base/default.nix index e817afc..eba1984 100644 --- a/modules/nixos/services/base/default.nix +++ b/modules/nixos/services/base/default.nix @@ -159,8 +159,12 @@ in ]; flake = lib.mkDefault "git+https://git.hoyer.xyz/harald/nixcfg"; }; + systemd.services.nixos-upgrade = { 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;