From b2a8e45127ea6e524a8faf8845b14d57d4225f96 Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Thu, 2 Nov 2023 08:32:51 +0100 Subject: [PATCH] sombrero: Add `git` module --- hosts/sombrero/configuration.nix | 2 +- hosts/sombrero/modules/git/default.nix | 23 +++++++++++++++++++++++ hosts/sombrero/modules/git/gitconfig | 6 ++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 hosts/sombrero/modules/git/default.nix create mode 100644 hosts/sombrero/modules/git/gitconfig diff --git a/hosts/sombrero/configuration.nix b/hosts/sombrero/configuration.nix index caad42f..2590fbc 100644 --- a/hosts/sombrero/configuration.nix +++ b/hosts/sombrero/configuration.nix @@ -69,7 +69,6 @@ gnumake mkpasswd vim - git tig unar ]; @@ -79,6 +78,7 @@ }; mod = { + git.enable = true; ssh.enable = true; docker.enable = true; nginx.enable = true; diff --git a/hosts/sombrero/modules/git/default.nix b/hosts/sombrero/modules/git/default.nix new file mode 100644 index 0000000..54d6b8e --- /dev/null +++ b/hosts/sombrero/modules/git/default.nix @@ -0,0 +1,23 @@ +{ pkgs, lib, config, ... }: +let + enabled = config.mod.git.enable; +in +{ + options = { + mod.git = { + enable = lib.mkEnableOption "enable git module"; + }; + }; + + config = lib.mkIf enabled { + home-manager.users.alex = { + programs.git = { + enable = true; + + includes = [ + { path = ./gitconfig; } + ]; + }; + }; + }; +} diff --git a/hosts/sombrero/modules/git/gitconfig b/hosts/sombrero/modules/git/gitconfig new file mode 100644 index 0000000..093916a --- /dev/null +++ b/hosts/sombrero/modules/git/gitconfig @@ -0,0 +1,6 @@ +[user] + name = Alexander Heldt + email = me@alexanderheldt.se + +[url "git@github.com:"] + insteadOf = https://github.com/