From a42c8f0aeb382a1b1079047a9d753041a442d304 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Mon, 5 Jun 2023 04:31:16 +0800 Subject: [PATCH] fix: 'programs.git' do not take effect --- home/common/git.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/home/common/git.nix b/home/common/git.nix index e9ab9bb9..26380841 100644 --- a/home/common/git.nix +++ b/home/common/git.nix @@ -1,7 +1,17 @@ { + config, + lib, pkgs, ... }: { + # `programs.git` will generate the config file: ~/.config/git/config + # to make git use this config file, `~/.gitconfig` should not exist! + # + # https://git-scm.com/docs/git-config#Documentation/git-config.txt---global + home.activation.removeExistingGitconfig = lib.hm.dag.entryBefore ["checkLinkTargets"] '' + rm -f ~/.gitconfig + ''; + programs.git = { enable = true; lfs.enable = true; @@ -12,8 +22,8 @@ includes = [ { # use diffrent email & name for work - path = "~/mobiuspace/.gitconfig"; - condition = "gitdir:~/mobiuspace/"; + path = "~/work/.gitconfig"; + condition = "gitdir:~/work/"; } ];