From df967b99b4c553ba81eb158fa396df50d321f44b Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Thu, 5 Oct 2023 22:39:02 +0200 Subject: [PATCH] pinwheel: Set `git` editor to `vim` --- hosts/pinwheel/modules/git/gitconfig | 3 --- hosts/pinwheel/modules/vim/default.nix | 13 ++++++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/hosts/pinwheel/modules/git/gitconfig b/hosts/pinwheel/modules/git/gitconfig index d8d800e..ac8834a 100644 --- a/hosts/pinwheel/modules/git/gitconfig +++ b/hosts/pinwheel/modules/git/gitconfig @@ -2,9 +2,6 @@ name = Alexander Heldt email = me@alexanderheldt.se -[core] - editor = "vim" - [url "git@github.com:"] insteadOf = https://github.com/ diff --git a/hosts/pinwheel/modules/vim/default.nix b/hosts/pinwheel/modules/vim/default.nix index 9842524..21d5211 100644 --- a/hosts/pinwheel/modules/vim/default.nix +++ b/hosts/pinwheel/modules/vim/default.nix @@ -1,4 +1,7 @@ -{ ... }: +{ lib, config, ... }: +let + gitEnabled = config.mod.git.enable; +in { home-manager.users.alex = { programs.vim = { @@ -8,5 +11,13 @@ set noswapfile ''; }; + + programs.git = lib.mkIf gitEnabled { + extraConfig = { + core = { + editor = "vim"; + }; + }; + }; }; }