From 485e1448fcaa84862515d4c8222bd289c57f411c Mon Sep 17 00:00:00 2001 From: oddlama Date: Sun, 17 Sep 2023 22:31:58 +0200 Subject: [PATCH] feat: add zsh-skim-histdb package --- pkgs/default.nix | 2 ++ pkgs/zsh-skim-histdb.nix | 28 ++++++++++++++++++++++ users/modules/config/shell/default.nix | 2 ++ users/modules/config/shell/zsh/default.nix | 7 +----- 4 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 pkgs/zsh-skim-histdb.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 1d70235..84f1a1e 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -31,5 +31,7 @@ hash = "sha256-iZUszwVcbVn6Xsqou6crSp9gJBRmm5vEqxS87h/s3PQ="; }; }); + + zsh-histdb-skim = super.callPackage ./zsh-skim-histdb.nix {}; }) ] diff --git a/pkgs/zsh-skim-histdb.nix b/pkgs/zsh-skim-histdb.nix new file mode 100644 index 0000000..84fdb80 --- /dev/null +++ b/pkgs/zsh-skim-histdb.nix @@ -0,0 +1,28 @@ +{ + fetchFromGitHub, + rustPlatform, + sqlite, +}: +rustPlatform.buildRustPackage rec { + pname = "zsh-histdb-skim"; + version = "0.8.6"; + + buildInputs = [sqlite]; + src = fetchFromGitHub { + owner = "m42e"; + repo = "zsh-histdb-skim"; + rev = "v${version}"; + hash = "sha256-lJ2kpIXPHE8qP0EBnLuyvatWMtepBobNAC09e7itGas="; + }; + + cargoHash = "sha256-yvgyqm8WM7Oddxsbl/lfHQOmsEEiMTK6itbqea5+Ibg="; + + patchPhase = '' + substituteInPlace zsh-histdb-skim-vendored.zsh \ + --replace zsh-histdb-skim "$out/bin/zsh-histdb-skim" + ''; + + postInstall = '' + cp zsh-histdb-skim-vendored.zsh $out/zsh-histdb-skim.plugin.zsh + ''; +} diff --git a/users/modules/config/shell/default.nix b/users/modules/config/shell/default.nix index 9954fc5..8947c9e 100644 --- a/users/modules/config/shell/default.nix +++ b/users/modules/config/shell/default.nix @@ -19,6 +19,8 @@ chmod = "chmod -c --preserve-root"; chown = "chown -c --preserve-root"; + nb = "nix build --no-link --print-out-paths"; + ip = "ip --color"; tmux = "tmux -2"; rg = "rg -S"; diff --git a/users/modules/config/shell/zsh/default.nix b/users/modules/config/shell/zsh/default.nix index bb60227..229c44f 100644 --- a/users/modules/config/shell/zsh/default.nix +++ b/users/modules/config/shell/zsh/default.nix @@ -46,12 +46,7 @@ } { name = "zsh-histdb-skim"; - src = pkgs.fetchFromGitHub { - owner = "m42e"; - repo = "zsh-histdb-skim"; - rev = "3af19b6ec38b93c85bb82a80a69bec8b0e050cc5"; - hash = "sha256-lJ2kpIXPHE8qP0EBnLuyvatWMtepBobNAC09e7itGas="; - }; + src = pkgs.zsh-histdb-skim; } ]; };