diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-03-13 21:36:35 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-03-13 21:36:35 +0000 |
commit | f3b8160f2c87a5021b7c0c99a654f4279e5289f5 (patch) | |
tree | b44ef49506b257df48ad09da0d6f228a9608d169 /modules/shell | |
parent | c909506f3054a90e2545b15f9448f16d9a8df488 (diff) | |
download | nixlib-f3b8160f2c87a5021b7c0c99a654f4279e5289f5.tar nixlib-f3b8160f2c87a5021b7c0c99a654f4279e5289f5.tar.gz nixlib-f3b8160f2c87a5021b7c0c99a654f4279e5289f5.tar.bz2 nixlib-f3b8160f2c87a5021b7c0c99a654f4279e5289f5.tar.lz nixlib-f3b8160f2c87a5021b7c0c99a654f4279e5289f5.tar.xz nixlib-f3b8160f2c87a5021b7c0c99a654f4279e5289f5.tar.zst nixlib-f3b8160f2c87a5021b7c0c99a654f4279e5289f5.zip |
modules/git: add JSON textconv
Diffstat (limited to 'modules/shell')
-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; } |