From 9f65a9f4c116f657f2b54d79890a88421706ec24 Mon Sep 17 00:00:00 2001 From: Doloro1978 Date: Tue, 21 Oct 2025 09:58:23 +0100 Subject: [PATCH] qol(git@modules): git is now a module --- nix/hosts/doloro-wsl/home.nix | 7 +------ nix/hosts/doloro/home.nix | 13 +++++++------ nix/modules/git/default.nix | 3 +++ nix/modules/git/home.nix | 28 ++++++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 nix/modules/git/default.nix create mode 100644 nix/modules/git/home.nix diff --git a/nix/hosts/doloro-wsl/home.nix b/nix/hosts/doloro-wsl/home.nix index 825bce9..f5e4ed2 100644 --- a/nix/hosts/doloro-wsl/home.nix +++ b/nix/hosts/doloro-wsl/home.nix @@ -29,18 +29,13 @@ fish.enable = true; stylix.enable = true; direnv.enable = true; + git.enable = true; }; # Home Manager needs a bit of information about you and the paths it should # manage. home.username = "doloro"; home.homeDirectory = "/home/doloro"; - programs.git = { - enable = true; - userName = "Doloro1978"; - userEmail = "doloroo@proton.me"; - }; - # This value determines the Home Manager release that your configuration is # compatible with. This helps avoid breakage when a new Home Manager release # introduces backwards incompatible changes. diff --git a/nix/hosts/doloro/home.nix b/nix/hosts/doloro/home.nix index 89c2afb..92efe85 100644 --- a/nix/hosts/doloro/home.nix +++ b/nix/hosts/doloro/home.nix @@ -36,19 +36,18 @@ youtube-music.enable = true; unityhub.enable = true; direnv.enable = true; + git.enable = true; }; # Home Manager needs a bit of information about you and the paths it should # manage. home.username = "doloro"; home.homeDirectory = "/home/doloro"; - programs.git = { + services.gpg-agent = { enable = true; - settings = { - user = { - name = "Doloro1978"; - email = "doloroo@proton.me"; - }; + pinentry = { + package = pkgs.pinentry-qt; + program = "pinentry-qt"; }; }; xdg.mimeApps.enable = true; @@ -75,6 +74,7 @@ btop sops alcom + gcr ]; # sops.age.keyFile = "/home/doloro/.config/sops/age/key.txt"; @@ -117,6 +117,7 @@ enable = true; }; }; + xdg.configFile."mimeapps.list".force = true; # Let Home Manager install and manage itself. programs.home-manager.enable = true; } diff --git a/nix/modules/git/default.nix b/nix/modules/git/default.nix new file mode 100644 index 0000000..3f46f00 --- /dev/null +++ b/nix/modules/git/default.nix @@ -0,0 +1,3 @@ +_: { + home = ./home.nix; +} diff --git a/nix/modules/git/home.nix b/nix/modules/git/home.nix new file mode 100644 index 0000000..3fdcc72 --- /dev/null +++ b/nix/modules/git/home.nix @@ -0,0 +1,28 @@ +{ config, lib, ... }: +let + cfg = config.modules.git; +in +{ + + options.modules.git = { + enable = lib.mkEnableOption "git"; + }; + config.programs = lib.mkIf cfg.enable { + git = { + enable = true; + settings = { + user = { + name = "Doloro1978"; + email = "doloroo@proton.me"; + signingKey = "089B373588540877"; + }; + commit = { + gpgSign = true; + }; + }; + }; + gpg = { + enable = true; + }; + }; +}