pinwheel: Add enable option to git module
And use it to check when to add work `gitconfig`
This commit is contained in:
@@ -126,7 +126,11 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
config-manager.flakePath = "/home/alex/config";
|
config-manager.flakePath = "/home/alex/config";
|
||||||
mod.openvpn.enable = true;
|
|
||||||
|
mod = {
|
||||||
|
git.enable = true;
|
||||||
|
openvpn.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
# This value determines the NixOS release from which the default
|
||||||
# settings for stateful data, like file locations and database versions
|
# settings for stateful data, like file locations and database versions
|
||||||
|
|||||||
@@ -1,12 +1,23 @@
|
|||||||
{ ... }:
|
{ lib, config, ... }:
|
||||||
|
let
|
||||||
|
enabled = config.mod.git.enable;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
home-manager.users.alex = {
|
options = {
|
||||||
programs.git = {
|
mod.git = {
|
||||||
enable = true;
|
enable = lib.mkEnableOption "enable git module";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
includes = [
|
config = lib.mkIf enabled {
|
||||||
{ path = ./gitconfig; }
|
home-manager.users.alex = {
|
||||||
];
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
includes = [
|
||||||
|
{ path = ./gitconfig; }
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{ pkgs, lib, config, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
let
|
let
|
||||||
|
gitEnabled = config.mod.git.enable;
|
||||||
openvpnEnabled = config.mod.openvpn.enable;
|
openvpnEnabled = config.mod.openvpn.enable;
|
||||||
|
|
||||||
work-vpn = let
|
work-vpn = let
|
||||||
@@ -25,7 +26,7 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
home-manager.users.alex = {
|
home-manager.users.alex = {
|
||||||
programs.git = {
|
programs.git = lib.mkIf gitEnabled {
|
||||||
includes = [
|
includes = [
|
||||||
{
|
{
|
||||||
path = ./work-gitconfig;
|
path = ./work-gitconfig;
|
||||||
|
|||||||
Reference in New Issue
Block a user