From f829f8288523f1ecff869c02179ced7d3620cc20 Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Mon, 30 Jun 2025 19:44:19 -0500 Subject: [PATCH] profile option finally working --- flake.nix | 11 +++++------ git-personal.nix | 9 --------- git.nix | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 15 deletions(-) delete mode 100644 git-personal.nix create mode 100644 git.nix diff --git a/flake.nix b/flake.nix index f746645..25e385d 100644 --- a/flake.nix +++ b/flake.nix @@ -2,13 +2,11 @@ description = "Home Manager configuration flake for JSL"; inputs = { - # Specify the source of Home Manager and Nixpkgs. nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - home-manager.url = "github:nix-community/home-manager"; - # home-manager = { - # url = "github:nix-community/home-manager"; - # inputs.nixpkgs.follows = "nixpkgs"; - # }; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { nixpkgs, home-manager, ... }: @@ -22,6 +20,7 @@ imports = [ ./options.nix ./home.nix + ./git.nix ]; }; }; diff --git a/git-personal.nix b/git-personal.nix deleted file mode 100644 index d30ba88..0000000 --- a/git-personal.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: -{ - programs.git = { - enable = true; - extraConfig.credential.helper = "store --file ~/.git-credentials"; - userName = "John Lancaster"; - userEmail = "32917998+jsl12@users.noreply.github.com"; - }; -} \ No newline at end of file diff --git a/git.nix b/git.nix new file mode 100644 index 0000000..95259b0 --- /dev/null +++ b/git.nix @@ -0,0 +1,18 @@ +{ config, lib, ... }: +{ + programs.git = lib.mkMerge [ + { + enable = true; + extraConfig.credential.helper = "store --file ~/.git-credentials"; + } + (lib.mkIf (config.profile == "personal") { + userName = "John Lancaster"; + userEmail = "32917998+jsl12@users.noreply.github.com"; + + }) + (lib.mkIf (config.profile == "work") { + userName = "John Lancaster"; + userEmail = "john.lancaster@crowncastle.com"; + }) + ]; +} \ No newline at end of file