Add git home module
Allows me to avoid configuring my name any time I want to use git
This commit is contained in:
parent
974bb922cb
commit
6dc2fc4e44
2 changed files with 21 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
imports = [
|
||||
./fish.nix
|
||||
./git.nix
|
||||
./neovim.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
20
modules/home/git.nix
Normal file
20
modules/home/git.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ config, configFiles, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
options.myModules.home.git = {
|
||||
enable = mkEnableOption "custom git configuration";
|
||||
};
|
||||
|
||||
config = mkIf config.myModules.home.git.enable (
|
||||
let
|
||||
configPath = (configFiles + "/users/${config.myModules.home.user}/gitconfig");
|
||||
in {
|
||||
# Use the correct Home Manager option
|
||||
home.file.".gitconfig" = {
|
||||
source = configPath;
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue