diff --git a/.gdb_history b/.gdb_history deleted file mode 100644 index e69de29..0000000 diff --git a/flake.nix b/flake.nix index 333aa68..4eb1079 100644 --- a/flake.nix +++ b/flake.nix @@ -116,6 +116,7 @@ pkgs = import nixpkgs { overlays = import ./lib inputs + ++ import ./pkgs ++ [ inputs.nixpkgs-wayland.overlay ]; diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..89419b3 --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,6 @@ +[ + (_self: super: { + zsh-histdb-skim = super.callPackage ./zsh-histdb-skim.nix {}; + zsh-histdb = super.callPackage ./zsh-histdb.nix {}; + }) +] diff --git a/pkgs/zsh-histdb-skim.nix b/pkgs/zsh-histdb-skim.nix new file mode 100644 index 0000000..9f4f244 --- /dev/null +++ b/pkgs/zsh-histdb-skim.nix @@ -0,0 +1,22 @@ +{ + rustPlatform, + sqlite, + fetchFromGitHub, +}: +rustPlatform.buildRustPackage rec { + pname = "zsh-histd-skim"; + version = "0.8.6"; + buildInputs = [sqlite]; + src = fetchFromGitHub { + owner = "m42e"; + repo = "zsh-histdb-skim"; + rev = "v${version}"; + hash = "sha256-lJ2kpIXPHE8qP0EBnLuyvatWMtepBobNAC09e7itGas="; + }; + cargoHash = "sha256-BMy9Shy9KAx5+VbvH2WaA0wMFUNM5dqU/dssUNE1NWY="; + postInstall = '' + substituteInPlace zsh-histdb-skim-vendored.zsh \ + --replace "zsh-histdb-skim" "$out/bin/zsh-histdb-skim" + cp zsh-histdb-skim-vendored.zsh $out/zsh-histdb-skim.plugin.zsh + ''; +} diff --git a/pkgs/zsh-histdb.nix b/pkgs/zsh-histdb.nix new file mode 100644 index 0000000..ea9a453 --- /dev/null +++ b/pkgs/zsh-histdb.nix @@ -0,0 +1,22 @@ +{ + stdenv, + fetchFromGitHub, + sqlite, +}: +stdenv.mkDerivation { + name = "zsh-histdb"; + src = fetchFromGitHub { + owner = "larkery"; + repo = "zsh-histdb"; + rev = "30797f0c50c31c8d8de32386970c5d480e5ab35d"; + hash = "sha256-PQIFF8kz+baqmZWiSr+wc4EleZ/KD8Y+lxW2NT35/bg="; + }; + patchPhase = '' + substituteInPlace "sqlite-history.zsh" "histdb-migrate" "histdb-merge" \ + --replace "sqlite3" "${sqlite}/bin/sqlite3" + ''; + installPhase = '' + mkdir -p $out + cp -r * $out + ''; +} diff --git a/users/common/shells/alias.nix b/users/common/shells/alias.nix index 74ee00c..7368fb7 100644 --- a/users/common/shells/alias.nix +++ b/users/common/shells/alias.nix @@ -25,5 +25,6 @@ zf = "zathura --fork"; gdb = "${pkgs.pwndbg}/bin/pwndbg"; + build = "nix build --no-link --print-out-paths"; }; } diff --git a/users/common/shells/zsh/default.nix b/users/common/shells/zsh/default.nix index 9600de5..742cfba 100644 --- a/users/common/shells/zsh/default.nix +++ b/users/common/shells/zsh/default.nix @@ -57,43 +57,11 @@ { # TODO change to separate packages name = "zsh-histdb"; - src = pkgs.stdenv.mkDerivation { - name = "zsh-histdb"; - src = pkgs.fetchFromGitHub { - owner = "larkery"; - repo = "zsh-histdb"; - rev = "30797f0c50c31c8d8de32386970c5d480e5ab35d"; - hash = "sha256-PQIFF8kz+baqmZWiSr+wc4EleZ/KD8Y+lxW2NT35/bg="; - }; - patchPhase = '' - substituteInPlace "sqlite-history.zsh" "histdb-migrate" "histdb-merge" \ - --replace "sqlite3" "${pkgs.sqlite}/bin/sqlite3" - ''; - installPhase = '' - mkdir -p $out - cp -r * $out - ''; - }; + src = pkgs.zsh-histdb; } { name = "zsh-histdb-skim"; - src = pkgs.rustPlatform.buildRustPackage rec { - pname = "zsh-histd-skim"; - version = "0.8.6"; - buildInputs = [pkgs.sqlite]; - src = pkgs.fetchFromGitHub { - owner = "m42e"; - repo = "zsh-histdb-skim"; - rev = "v${version}"; - hash = "sha256-lJ2kpIXPHE8qP0EBnLuyvatWMtepBobNAC09e7itGas="; - }; - cargoHash = "sha256-BMy9Shy9KAx5+VbvH2WaA0wMFUNM5dqU/dssUNE1NWY="; - postInstall = '' - substituteInPlace zsh-histdb-skim-vendored.zsh \ - --replace "zsh-histdb-skim" "$out/bin/zsh-histdb-skim" - cp zsh-histdb-skim-vendored.zsh $out/zsh-histdb-skim.plugin.zsh - ''; - }; + src = pkgs.zsh-histdb-skim; } ]; };