Skip to content

Commit

Permalink
feat(git): use my watchman fork for now
Browse files Browse the repository at this point in the history
  • Loading branch information
nekowinston committed Feb 4, 2025
1 parent 099c26b commit c1f2708
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
7 changes: 5 additions & 2 deletions home/apps/git/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ in
}
];

home.packages = [ pkgs.git-ignore ];
home.packages = with pkgs; [
git-ignore
watchman
];

# disable loading the system config on Darwin, where Nix tells it to use the
# osxkeychain credential manager.
Expand Down Expand Up @@ -72,7 +75,7 @@ in
];

extraConfig = {
core.fsmonitor = true;
core.fsmonitor = lib.getExe pkgs.rs-git-fsmonitor;
credential.helper = "gopass";
init.defaultBranch = "main";
push.default = "current";
Expand Down
29 changes: 29 additions & 0 deletions pkgs/overlays.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
(
final: prev:
let
inherit (final) lib;
inherit (final.stdenv) system;
nvfetcherSrcs = final.callPackage ../_sources/generated.nix { };
in
Expand All @@ -20,6 +21,34 @@
nurpkgs = final;
pkgs = final;
};
rs-git-fsmonitor = final.rustPlatform.buildRustPackage rec {
pname = "rs-git-fsmonitor";
version = "0.2.0-git-rust-client";

src = final.fetchFromGitHub {
owner = "nekowinston";
repo = "rs-git-fsmonitor";
rev = "7317d9b201a540e12468bca3272baa59be1a5382";
sha256 = "sha256-VdF7FamqveSJLrcspTLZ0LGk7SMgYG1+muryCYLjP78=";
};

cargoHash = "sha256-gcWi2gczg6eiYIJrrP76e9PqMBll0MTnAFT5BA/30as=";

nativeBuildInputs = [ final.makeWrapper ];

fixupPhase = ''
wrapProgram $out/bin/rs-git-fsmonitor --prefix PATH ":" "${lib.makeBinPath [ final.watchman ]}"
'';

meta = {
description = "Fast git core.fsmonitor hook written in Rust";
homepage = "https://github.com/jgavris/rs-git-fsmonitor";
changelog = "https://github.com/jgavris/rs-git-fsmonitor/releases/tag/v${version}";
license = lib.licenses.mit;
maintainers = [ ];
mainProgram = "rs-git-fsmonitor";
};
};
starship = prev.starship.overrideAttrs (old: {
patches = [
# to allow loading config values from env vars
Expand Down

0 comments on commit c1f2708

Please sign in to comment.