diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/shell/git/attributes | 1 | ||||
-rw-r--r-- | modules/shell/git/config.in (renamed from modules/shell/git/config.nix) | 8 | ||||
-rw-r--r-- | modules/shell/git/default.nix | 14 |
3 files changed, 17 insertions, 6 deletions
diff --git a/modules/shell/git/attributes b/modules/shell/git/attributes index 6f33cd4e46e9..51037ea8c46a 100644 --- a/modules/shell/git/attributes +++ b/modules/shell/git/attributes @@ -1 +1,2 @@ +*.json diff=json *.plist diff=plist diff --git a/modules/shell/git/config.nix b/modules/shell/git/config.in index dc605551a18c..ee4dcef4c1e1 100644 --- a/modules/shell/git/config.nix +++ b/modules/shell/git/config.in @@ -1,7 +1,6 @@ -'' [core] - attributesfile = ${./attributes} - excludesfile = ${./ignore} + attributesfile = @attributesfile@ + excludesfile = @ignorefile@ [alias] ignore = "!gi() { curl -L -s https://www.gitignore.io/api/$@ ;}; gi" unbranch = "!git branch --sort -HEAD --merged | sed 1d | xargs git branch -d" @@ -42,6 +41,8 @@ protocol = ssh [branch] autosetuprebase = always +[diff "json"] + textconv = @python@/bin/python -m json.tool [diff "plist"] textconv = /usr/bin/plutil -convert xml1 -o - [format] @@ -49,4 +50,3 @@ [grep] lineNumber = true patternType = perl -'' diff --git a/modules/shell/git/default.nix b/modules/shell/git/default.nix index 56b7af620d4c..1257752e9967 100644 --- a/modules/shell/git/default.nix +++ b/modules/shell/git/default.nix @@ -1,8 +1,18 @@ { pkgs, ... }: +let + config = pkgs.runCommand "gitconfig" { + python = pkgs.python3; + attributesfile = ./attributes; + ignorefile = ./ignore; + preferLocalBuild = true; + } '' + substituteAll ${./config.in} $out + ''; + +in { environment.systemPackages = with pkgs; [ gitSVN ]; - xdg.config.users.qyliss.paths."git/config" = - pkgs.writeText "gitconfig" (import ./config.nix); + xdg.config.users.qyliss.paths."git/config" = config; } |