Files
nixpkgs/pkgs/zellij-ps/default.nix
T

48 lines
1.3 KiB
Nix

{
lib,
stdenv,
fetchFromGitea,
fish,
fd,
fzf,
zellij,
}:
with lib;
stdenv.mkDerivation {
pname = "zellij-ps";
version = "0.1.0";
# Branch-tracking source: follows the tip of the master branch of
# code.m3ta.dev/m3tam3re/helper-scripts. The repo has no tags, so we
# track commits via the Gitea API (see ./update.sh).
src = fetchFromGitea {
domain = "code.m3ta.dev";
owner = "m3tam3re";
repo = "helper-scripts";
rev = "d30382d8692399d952a1aacbdb77e6ab87ba046d";
sha256 = "0zrl8089qj14gwn9k3b73vnw2zn48f9yh9w0qbh8g8mb171sxyaj";
};
propagatedBuildInputs = [fish fd fzf zellij];
nativeBuildInputs = [];
installPhase = ''
mkdir -p $out/bin
substitute zellij-ps.fish $out/bin/zellij-ps \
--replace-fail 'fd --type' '${fd}/bin/fd --type' \
--replace-fail 'fzf --preview' '${fzf}/bin/fzf --preview' \
--replace-fail 'zellij --layout' '${zellij}/bin/zellij --layout' \
--replace-fail 'pgrep -c zellij' 'pgrep -c ${zellij}/bin/zellij'
chmod +x $out/bin/zellij-ps
'';
passthru.updateScript = ./update.sh;
meta = {
description = "Zellij project switcher - quickly switch between project folders";
license = lib.licenses.mit;
platforms = platforms.unix;
mainProgram = "zellij-ps";
};
}