Skip to content

Commit

Permalink
fix(git): Use package reference for pkgs.delta
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjones2014 committed Aug 17, 2023
1 parent 7563525 commit d7b9076
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions home-manager/modules/git.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
let
inherit (pkgs) git stdenv;
inherit (stdenv) isLinux;
gitCheckoutScript = pkgs.writeScript "git-ch.bash" ''
git_checkout_fzf_script = pkgs.writeScript "git-ch.bash" ''
#!${pkgs.bash}/bin/bash
if test "$#" -ne 0; then
if [[ "$*" = "master" ]] || [[ "$*" = "main" ]]; then
Expand All @@ -15,7 +15,6 @@ let
fi
'';
in {
home.packages = [ pkgs.delta ];
programs.git = {
enable = true;
package = git.override {
Expand All @@ -28,7 +27,7 @@ in {
commit-amend = "commit -a --amend --no-edit";
prune-branches = ''
!git branch --merged | grep -v \"master\" | grep -v \"main\" | grep -v \"$(git branch --show-current)\" | grep -v "[*]" >/tmp/merged-branches && vim /tmp/merged-branches && xargs git branch -d </tmp/merged-branches && git fetch --prune'';
ch = "!${gitCheckoutScript}";
ch = "!${git_checkout_fzf_script}";
add-ignore-whitespace =
"!git diff --ignore-all-space | git apply --cached";
copy-branch = "!git branch --show-current | ${
Expand Down Expand Up @@ -57,11 +56,11 @@ in {
};
core = {
autocrlf = false;
pager = "delta";
pager = "${pkgs.delta}/bin/delta";
fsmonitor = true;
untrackedcache = true;
};
interactive = { diffFilter = "delta --color-only"; };
interactive = { diffFilter = "${pkgs.delta}/bin/delta --color-only"; };
init = { defaultBranch = "master"; };
delta = {
lineNumbers = true;
Expand Down

0 comments on commit d7b9076

Please sign in to comment.