pinwheel: Add enable option to git module

And use it to check when to add work `gitconfig`
This commit is contained in:
Alexander Heldt
2023-10-01 22:54:00 +02:00
parent 4fc4726f22
commit 408751cce5
3 changed files with 25 additions and 9 deletions

View File

@@ -1,12 +1,23 @@
{ ... }:
{ lib, config, ... }:
let
enabled = config.mod.git.enable;
in
{
home-manager.users.alex = {
programs.git = {
enable = true;
options = {
mod.git = {
enable = lib.mkEnableOption "enable git module";
};
};
includes = [
{ path = ./gitconfig; }
];
config = lib.mkIf enabled {
home-manager.users.alex = {
programs.git = {
enable = true;
includes = [
{ path = ./gitconfig; }
];
};
};
};
}