home/base: enable Git maintenance
This is enabled in home-manager becuase Git attempts to hardcode the path when it is done through Git. Enabling Git in home-manager creates a managed config at $XDG_CONFIG_HOME/git/config, but if ~/.gitconfig exists, git will use that instead which still allows for mutable config. The activation script is configured to automatically create ~/.gitconfig if it doesn't exist, so everything should still work exactly as before.
This commit is contained in:
parent
8d011735f4
commit
acb902b1ad
@ -35,6 +35,25 @@ in
|
|||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
|
programs.git = {
|
||||||
|
enable = lib.mkDefault true;
|
||||||
|
maintenance.enable = lib.mkDefault true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# this allows `git config --global` commands to work by ensuring the
|
||||||
|
# presense of ~/.gitconfig. git will read from both files, and `git config`
|
||||||
|
# will not write to ~/.gitconfig when the managed config exists unless
|
||||||
|
# ~/.gitconfig also exists
|
||||||
|
home.activation.git-create-gitconfig = lib.mkIf config.programs.git.enable
|
||||||
|
(lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
|
_nixfiles_git_create_gitconfig () {
|
||||||
|
if ! [[ -a "$HOME/.gitconfig" ]] ; then
|
||||||
|
touch "$HOME/.gitconfig"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
run _nixfiles_git_create_gitconfig
|
||||||
|
'');
|
||||||
|
|
||||||
programs.btop.enable = lib.mkDefault true;
|
programs.btop.enable = lib.mkDefault true;
|
||||||
|
|
||||||
programs.ranger = let
|
programs.ranger = let
|
||||||
|
Loading…
x
Reference in New Issue
Block a user