all repos — nixfiles @ 6ad43ebe21d27c0eb8b8a971c7fbcece166bd3b5

System and user configuration, managed by nix and home-manager

workstation: don't clobber programs.git.attributes
Alan Pearce alan@alanpearce.eu
Mon, 24 Mar 2025 00:29:46 +0100
commit

6ad43ebe21d27c0eb8b8a971c7fbcece166bd3b5

parent

42194145e701ff01992b309c41d3e3b73b43ba05

1 files changed, 39 insertions(+), 5 deletions(-)

jump to
M user/settings/workstation.nixuser/settings/workstation.nix
@@ -33,6 +33,45 @@ programs.git = {     difftastic = {
       enable = true;
     };
+    attributes = [
+      # `mergiraf languages --gitattributes`
+      "*.java merge=mergiraf"
+      "*.kt merge=mergiraf"
+      "*.rs merge=mergiraf"
+      "*.go merge=mergiraf"
+      "*.js merge=mergiraf"
+      "*.jsx merge=mergiraf"
+      "*.mjs merge=mergiraf"
+      "*.json merge=mergiraf"
+      "*.yml merge=mergiraf"
+      "*.yaml merge=mergiraf"
+      "*.toml merge=mergiraf"
+      "*.html merge=mergiraf"
+      "*.htm merge=mergiraf"
+      "*.xhtml merge=mergiraf"
+      "*.xml merge=mergiraf"
+      "*.c merge=mergiraf"
+      "*.h merge=mergiraf"
+      "*.cc merge=mergiraf"
+      "*.cpp merge=mergiraf"
+      "*.hpp merge=mergiraf"
+      "*.cs merge=mergiraf"
+      "*.dart merge=mergiraf"
+      "*.dts merge=mergiraf"
+      "*.scala merge=mergiraf"
+      "*.sbt merge=mergiraf"
+      "*.ts merge=mergiraf"
+      "*.tsx merge=mergiraf"
+      "*.py merge=mergiraf"
+      "*.php merge=mergiraf"
+      "*.phtml merge=mergiraf"
+      "*.sol merge=mergiraf"
+      "*.lua merge=mergiraf"
+      "*.rb merge=mergiraf"
+      "*.nix merge=mergiraf"
+      "*.sv merge=mergiraf"
+      "*.svh merge=mergiraf"
+    ];
     extraConfig = {
       "merge.mergiraf" = {
         name = "mergiraf";
@@ -60,10 +99,5 @@ ui = {         "diff.tool" = [ "${pkgs.difftastic}/bin/difft" "--color=always" "$left" "$right" ];
       };
     };
-  };
-  xdg.configFile."git/attributes" = {
-    source = (pkgs.runCommandLocal "mergiraf-gitattributes" { } ''
-      ${pkgs.mergiraf}/bin/mergiraf languages --gitattributes >> $out
-    '');
   };
 }