From 1f1ac4c575cab94b6c8cd466883f16ef90b4dde0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Sat, 30 Apr 2022 21:25:38 +0200 Subject: [PATCH] Add gitmessage template to global git config --- profiles/base-user/.config/git/config.nix | 1 + profiles/base-user/.config/git/gitmessage.nix | 35 +++++++++++++++++++ profiles/base-user/home.nix | 1 + 3 files changed, 37 insertions(+) create mode 100644 profiles/base-user/.config/git/gitmessage.nix diff --git a/profiles/base-user/.config/git/config.nix b/profiles/base-user/.config/git/config.nix index 53c53a77..2553ec66 100644 --- a/profiles/base-user/.config/git/config.nix +++ b/profiles/base-user/.config/git/config.nix @@ -24,6 +24,7 @@ in [commit] gpgsign = true + template = ${xdg.configHome}/git/gitmessage [tag] gpgsign = true [init] diff --git a/profiles/base-user/.config/git/gitmessage.nix b/profiles/base-user/.config/git/gitmessage.nix new file mode 100644 index 00000000..11cac0f9 --- /dev/null +++ b/profiles/base-user/.config/git/gitmessage.nix @@ -0,0 +1,35 @@ +{ config, pkgs, ... }: +let + user = config.pub-solar.user; + xdg = config.home-manager.users."${user.name}".xdg; +in +'' +# Title: Summary, imperative, start upper case, don't end with a period +# No more than 50 chars. #### 50 chars is here: # +# + +# +# Remember blank line between title and body. +# + +# +# Body: Explain *what* and *why* (not *how*). Include issue number. +# Wrap at 72 chars. ################################## which is here: # +# + +# +# At the end: Include Co-authored-by for all contributors. +# Include at least one empty line before it. Format: +# +Co-authored-by: ${user.fullName} <${user.email}> + +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# +# On branch master +# Your branch is up to date with 'origin/main'. +# +# Changes to be committed: +# new file: installation.md +# +'' diff --git a/profiles/base-user/home.nix b/profiles/base-user/home.nix index 6cb59b11..1ae6bd36 100644 --- a/profiles/base-user/home.nix +++ b/profiles/base-user/home.nix @@ -32,6 +32,7 @@ in xdg.mimeApps = import ./mimeapps.nix; xdg.configFile."git/config".text = import ./.config/git/config.nix { inherit config; inherit pkgs; }; + xdg.configFile."git/gitmessage".text = import ./.config/git/gitmessage.nix { inherit config; inherit pkgs; }; xdg.configFile."git/global_gitignore".text = import ./.config/git/global_gitignore.nix { inherit config; inherit pkgs; }; xdg.configFile."dircolors".source = ./.config/dircolors; xdg.configFile."xmodmap".source = ./.config/xmodmap;