From d99ada42c27f565263b22affd862e978bc63a73e Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 2 Oct 2024 16:12:33 -0400 Subject: [PATCH] add git-squash --- modules/home/all/git.nix | 1 + overlays/default.nix | 1 + packages/git-squash.nix | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 packages/git-squash.nix diff --git a/modules/home/all/git.nix b/modules/home/all/git.nix index cebefc0..46d43bc 100644 --- a/modules/home/all/git.nix +++ b/modules/home/all/git.nix @@ -2,6 +2,7 @@ { home.packages = with pkgs; [ git-filter-repo + git-squash # https://github.com/sheerun/git-squash ]; programs.git = { diff --git a/overlays/default.nix b/overlays/default.nix index a1e3f44..77f7473 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -15,4 +15,5 @@ self: super: { actualism-app = inputs.actualism-app.packages.${self.system}.default; omnix = inputs.omnix.packages.${self.system}.default; git-merge-and-delete = self.callPackage "${packages}/git-merge-and-delete.nix" { }; + git-squash = self.callPackage "${packages}/git-squash.nix" { }; } diff --git a/packages/git-squash.nix b/packages/git-squash.nix new file mode 100644 index 0000000..f4c675e --- /dev/null +++ b/packages/git-squash.nix @@ -0,0 +1,34 @@ +{ lib +, stdenv +, fetchFromGitHub +, bash +, git +}: + +stdenv.mkDerivation { + pname = "git-squash"; + version = "0.3.0"; + + src = fetchFromGitHub { + owner = "sheerun"; + repo = "git-squash"; + rev = "master"; + sha256 = "sha256-yvufKIwjP7VcIzLi8mE228hN4jmaqk90c8oxJtkXEP8="; + }; + + nativeBuildInputs = [ bash git ]; + + installPhase = '' + mkdir -p $out/bin + cp git-squash $out/bin/git-squash + chmod +x $out/bin/git-squash + ''; + + meta = with lib; { + description = "A Git command for squashing commits"; + homepage = "https://github.com/sheerun/git-squash"; + license = licenses.mit; # Adjust if the actual license is different + platforms = platforms.all; + maintainers = [ ]; # You can add maintainers if needed + }; +}