diff --git a/flake.nix b/flake.nix index b3f006f..071e88d 100644 --- a/flake.nix +++ b/flake.nix @@ -231,6 +231,7 @@ packages = { incus-ui = pkgs.callPackage ./pkgs/incus-ui { }; openfga = pkgs.callPackage ./pkgs/openfga { }; + gitu = pkgs.callPackage ./pkgs/gitu { }; }; devShells.default = diff --git a/home-manager/modules/git/default.nix b/home-manager/modules/git/default.nix index 4d91978..d7d9826 100644 --- a/home-manager/modules/git/default.nix +++ b/home-manager/modules/git/default.nix @@ -176,6 +176,9 @@ in }; }; - home.packages = [ pkgs.git-credential-manager ]; + home.packages = [ + pkgs.git-credential-manager + pkgs.gitu + ]; }; } diff --git a/overlays/default.nix b/overlays/default.nix index b9bba37..f16ac50 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -44,4 +44,5 @@ _final: prev: { incus-ui = prev.pkgs.callPackage ../pkgs/incus-ui { }; openfga = prev.pkgs.callPackage ../pkgs/openfga { }; + gitu = prev.pkgs.callPackage ../pkgs/gitu { }; } diff --git a/pkgs/gitu/default.nix b/pkgs/gitu/default.nix new file mode 100644 index 0000000..b77902b --- /dev/null +++ b/pkgs/gitu/default.nix @@ -0,0 +1,46 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + pkg-config, + libgit2, + openssl, + zlib, + stdenv, + darwin, + git, +}: + +rustPlatform.buildRustPackage rec { + pname = "gitu"; + version = "0.5.4"; + + src = fetchFromGitHub { + owner = "altsem"; + repo = "gitu"; + rev = "v${version}"; + hash = "sha256-a4hNgEizxanYE3XuHSCmbV6CkOqhXkznP3Sp0KLFFQs="; + }; + + cargoHash = "sha256-+CA3UG32oZedzRbt7b0wOlhH/subuym4BCL5SMNzrr8="; + + nativeBuildInputs = [ + pkg-config + git + ]; + + buildInputs = [ + libgit2 + openssl + zlib + ] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ]; + + meta = with lib; { + description = "A TUI Git client inspired by Magit"; + homepage = "https://github.com/altsem/gitu"; + changelog = "https://github.com/altsem/gitu/blob/${src.rev}/CHANGELOG.md"; + license = licenses.mit; + maintainers = with maintainers; [ ]; + mainProgram = "gitu"; + }; +}