From eb16a7d8d9a90e88a1ec8d5c65d91db021b4e1e1 Mon Sep 17 00:00:00 2001 From: Caroline Larimore Date: Fri, 7 Feb 2025 05:31:59 -0800 Subject: migration: git config --- roles/home/dev/default.nix | 1 - roles/home/dev/git.nix | 18 ---------- snowfall/homes/x86_64-linux/c/default.nix | 13 ++++++- snowfall/modules/home/suites/common/default.nix | 18 ++++++++++ snowfall/modules/home/tools/git/default.nix | 46 +++++++++++++++++++++++++ 5 files changed, 76 insertions(+), 20 deletions(-) delete mode 100644 roles/home/dev/git.nix create mode 100644 snowfall/modules/home/suites/common/default.nix create mode 100644 snowfall/modules/home/tools/git/default.nix diff --git a/roles/home/dev/default.nix b/roles/home/dev/default.nix index 3f5d6f2..b6a6366 100644 --- a/roles/home/dev/default.nix +++ b/roles/home/dev/default.nix @@ -19,7 +19,6 @@ let cfg = config.home.roles.dev; in { config = mkIf cfg.enable { programs = { - git.enable = true; vscode.enable = config.home.roles.desktop.enable; }; diff --git a/roles/home/dev/git.nix b/roles/home/dev/git.nix deleted file mode 100644 index be67fdb..0000000 --- a/roles/home/dev/git.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, ... }: - -{ - programs.git = { - userName = "Caroline Larimore"; - userEmail = "caroline@larimo.re"; - - signing = { - key = config.home.roles.dev.key; - signByDefault = true; - }; - - ignores = [ - "*~" - "*.swp" - ]; - }; -} diff --git a/snowfall/homes/x86_64-linux/c/default.nix b/snowfall/homes/x86_64-linux/c/default.nix index dabe340..f24778e 100644 --- a/snowfall/homes/x86_64-linux/c/default.nix +++ b/snowfall/homes/x86_64-linux/c/default.nix @@ -2,9 +2,20 @@ with lib; with lib.${namespace}; { cxl = { + suites = { + common.enable = true; + desktop.enable = true; + }; + desktop.background = "shinobu.png"; - suites.desktop.enable = true; + + tools.git = { + name = "Caroline Larimore"; + email = "caroline@larimo.re"; + key = "314C14641E707B68"; + }; }; home.stateVersion = "23.11"; } + diff --git a/snowfall/modules/home/suites/common/default.nix b/snowfall/modules/home/suites/common/default.nix new file mode 100644 index 0000000..c4620ee --- /dev/null +++ b/snowfall/modules/home/suites/common/default.nix @@ -0,0 +1,18 @@ +{ options, config, lib, namespace, ... }: + +with lib; with lib.${namespace}; let + cfg = config.${namespace}.suites.common; +in { + options.${namespace}.suites.common = with types; { + enable = mkEnableOption "common"; + }; + + config = mkIf cfg.enable { + cxl = { + tools = { + git.enable = true; + }; + }; + }; +} + diff --git a/snowfall/modules/home/tools/git/default.nix b/snowfall/modules/home/tools/git/default.nix new file mode 100644 index 0000000..8aebfd8 --- /dev/null +++ b/snowfall/modules/home/tools/git/default.nix @@ -0,0 +1,46 @@ +{ options, config, lib, namespace, ... }: + +with lib; with lib.${namespace}; let + cfg = config.${namespace}.tools.git; +in { + options.${namespace}.tools.git = with types; { + enable = mkEnableOption "git"; + + name = mkOption { + type = str; + }; + + email = mkOption { + type = str; + }; + + key = mkOption { + type = nullOr str; + }; + + sign = mkOption { + type = bool; + default = true; + }; + }; + + config = mkIf cfg.enable { + programs.git = { + enable = true; + + userName = cfg.name; + userEmail = cfg.email; + + signing = { + key = cfg.key; + signByDefault = cfg.sign; + }; + + ignores = [ + "*~" + "*.swp" + ]; + }; + }; +} + -- cgit v1.2.3