Make git config nix-darwin-aware

This commit is contained in:
2026-03-28 20:03:07 +00:00
parent 2abb541c71
commit 9e3ab4d17e

View File

@@ -1,15 +1,19 @@
# This module is supposed to be used on internal FutureWare servers. # This module is supposed to be used on internal FutureWare servers.
{ { lib, options, ... }:
programs.git.enable = true;
programs.git.config = { let
gitConfig = {
url."https://git.sheremet.ch/futureware-tech/nix.git".insteadOf = url."https://git.sheremet.ch/futureware-tech/nix.git".insteadOf =
"https://github.com/futureware-tech/nix.git"; "https://github.com/futureware-tech/nix.git";
url."https://git.sheremet.ch/artem/dotfiles.git".insteadOf = url."https://git.sheremet.ch/artem/dotfiles.git".insteadOf =
"https://github.com/dotdoom/dotfiles.git"; "https://github.com/dotdoom/dotfiles.git";
url."https://git.sheremet.ch/home/esphome.git".insteadOf = "https://github.com/dotdoom/esphome.git"; url."https://git.sheremet.ch/home/esphome.git".insteadOf = "https://github.com/dotdoom/esphome.git";
}; };
hasGitOption = options ? programs.git;
in
lib.mkMerge [
{
nix.settings = { nix.settings = {
substituters = [ substituters = [
"http://nix-cache.home.arpa" "http://nix-cache.home.arpa"
@@ -21,3 +25,14 @@
]; ];
}; };
} }
(lib.mkIf hasGitOption {
programs.git.enable = true;
programs.git.config = gitConfig;
})
(lib.mkIf (!hasGitOption) {
# nix-darwin
environment.etc."gitconfig".text = lib.generators.toGitINI gitConfig;
})
]