Make git config nix-darwin-aware
This commit is contained in:
@@ -1,23 +1,38 @@
|
|||||||
# 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 = {
|
||||||
|
substituters = [
|
||||||
|
"http://nix-cache.home.arpa"
|
||||||
|
# nix-community cachix server
|
||||||
|
# TODO: this, but through our cache -- "https://nix-community.cachix.org"
|
||||||
|
];
|
||||||
|
trusted-public-keys = [
|
||||||
|
# "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
nix.settings = {
|
(lib.mkIf hasGitOption {
|
||||||
substituters = [
|
programs.git.enable = true;
|
||||||
"http://nix-cache.home.arpa"
|
programs.git.config = gitConfig;
|
||||||
# nix-community cachix server
|
})
|
||||||
# TODO: this, but through our cache -- "https://nix-community.cachix.org"
|
|
||||||
];
|
(lib.mkIf (!hasGitOption) {
|
||||||
trusted-public-keys = [
|
# nix-darwin
|
||||||
# "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
environment.etc."gitconfig".text = lib.generators.toGitINI gitConfig;
|
||||||
];
|
})
|
||||||
};
|
]
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user