From b37f8a8e1ad63adb4cbcaa613c2f76cf5e7bb30f Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Thu, 23 Jan 2025 19:55:13 -0500 Subject: [PATCH] Do not install my git config on neelix. --- nix/configuration/hosts/odo/default.nix | 1 + nix/configuration/roles/git/default.nix | 36 ++++++++++++++++++------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/nix/configuration/hosts/odo/default.nix b/nix/configuration/hosts/odo/default.nix index 058a2c5..5c83289 100644 --- a/nix/configuration/hosts/odo/default.nix +++ b/nix/configuration/hosts/odo/default.nix @@ -37,6 +37,7 @@ me.docker.enable = true; me.emacs_flavor = "full"; me.firefox.enable = true; + me.git.config = ./roles/git/files/gitconfig_home; me.graphical = true; me.graphics_card_type = "amd"; me.sway.enable = true; diff --git a/nix/configuration/roles/git/default.nix b/nix/configuration/roles/git/default.nix index d3a930d..357748a 100644 --- a/nix/configuration/roles/git/default.nix +++ b/nix/configuration/roles/git/default.nix @@ -8,15 +8,31 @@ { imports = [ ]; - environment.systemPackages = with pkgs; [ - git - ]; - - home-manager.users.talexander = - { pkgs, ... }: - { - home.file.".gitconfig" = { - source = ./files/gitconfig_home; - }; + options.me = { + git.config = lib.mkOption { + type = lib.types.nullOr lib.types.path; + default = null; + example = ./files/gitconfig_home; + description = "A git config file."; }; + }; + + config = lib.mkMerge [ + { + environment.systemPackages = with pkgs; [ + git + ]; + } + ( + lib.mkIf config.me.git.config != null { + home-manager.users.talexander = + { pkgs, ... }: + { + home.file.".gitconfig" = { + source = config.me.git.config; + }; + }; + } + ) + ]; }