Skip to content

Commit

Permalink
feat: add and configure mergiraf for git
Browse files Browse the repository at this point in the history
  • Loading branch information
arichtman committed Nov 16, 2024
1 parent 2c7dbfc commit ed114a6
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 1 deletion.
17 changes: 17 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
description = "Ariel's machine configs";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
pkgsMaster.url = "github:nixos/nixpkgs/master";

snowfall-lib = {
url = "github:snowfallorg/lib/v3.0.2";
Expand Down
14 changes: 13 additions & 1 deletion modules/home/default-home/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
config,
pkgs,
lib,
inputs,
...
}: let
cfg = config.default-home;
Expand Down Expand Up @@ -248,7 +249,7 @@ in
};
# Note: regex to select non-comments ^[^#\n].*
# TODO: Generate the file from fetchURL call, run regex, remove .envrc line?
ignores = import ./.gitignore.nix;
ignores = import ./git/.gitignore.nix;
signing = {
signByDefault = true;
key = "~/.ssh/id_ed25519.pub";
Expand Down Expand Up @@ -279,6 +280,13 @@ in
autoSetupRemote = true;
default = "current";
};
merge.mergiraf = {
name = "mergiraf";
driver = "mergiraf merge --git %O %A %B -s %S -x %X -y %Y -p %P";
};
core = {
attributesfile = "~/.gitattributes";
};
url = {
"https://github.com" = {insteadOf = "gh";};
"https://gitlab.com" = {insteadOf = "gl";};
Expand Down Expand Up @@ -380,6 +388,9 @@ in
nixd
nil
ruff-lsp
# diff tool
# TODO: simplify when this hits unstable or whatever
inputs.pkgsMaster.legacyPackages.${system}.mergiraf
# langs
rustup
#TODO: dont have these on mac, aarch64 at least
Expand All @@ -399,6 +410,7 @@ in
source = ./terraform;
recursive = true;
};
".config/git/.gitattributes".source = git/.gitattributes;
# Required to create empty directory for Terraform plugin cache since TF won't create if not exist 🙄
# https://github.com/nix-community/home-manager/issues/2104
".terraform.d/plugin-cache/.keep".text = "";
Expand Down
19 changes: 19 additions & 0 deletions modules/home/default-home/git/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
*.java merge=mergiraf
*.rs merge=mergiraf
*.go merge=mergiraf
*.js merge=mergiraf
*.jsx merge=mergiraf
*.json merge=mergiraf
*.yml merge=mergiraf
*.yaml merge=mergiraf
*.html merge=mergiraf
*.htm merge=mergiraf
*.xhtml merge=mergiraf
*.xml merge=mergiraf
*.c merge=mergiraf
*.cc merge=mergiraf
*.h merge=mergiraf
*.cpp merge=mergiraf
*.hpp merge=mergiraf
*.cs merge=mergiraf
*.dart merge=mergiraf
File renamed without changes.

0 comments on commit ed114a6

Please sign in to comment.