feat: added nixpkgs overlay

This commit is contained in:
Patrick 2023-09-18 14:36:41 +02:00
parent 9670f735a2
commit be2cfd9402
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
7 changed files with 54 additions and 34 deletions

View file

View file

@ -116,6 +116,7 @@
pkgs = import nixpkgs { pkgs = import nixpkgs {
overlays = overlays =
import ./lib inputs import ./lib inputs
++ import ./pkgs
++ [ ++ [
inputs.nixpkgs-wayland.overlay inputs.nixpkgs-wayland.overlay
]; ];

6
pkgs/default.nix Normal file
View file

@ -0,0 +1,6 @@
[
(_self: super: {
zsh-histdb-skim = super.callPackage ./zsh-histdb-skim.nix {};
zsh-histdb = super.callPackage ./zsh-histdb.nix {};
})
]

22
pkgs/zsh-histdb-skim.nix Normal file
View file

@ -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
'';
}

22
pkgs/zsh-histdb.nix Normal file
View file

@ -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
'';
}

View file

@ -25,5 +25,6 @@
zf = "zathura --fork"; zf = "zathura --fork";
gdb = "${pkgs.pwndbg}/bin/pwndbg"; gdb = "${pkgs.pwndbg}/bin/pwndbg";
build = "nix build --no-link --print-out-paths";
}; };
} }

View file

@ -57,43 +57,11 @@
{ {
# TODO change to separate packages # TODO change to separate packages
name = "zsh-histdb"; name = "zsh-histdb";
src = pkgs.stdenv.mkDerivation { src = pkgs.zsh-histdb;
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
'';
};
} }
{ {
name = "zsh-histdb-skim"; name = "zsh-histdb-skim";
src = pkgs.rustPlatform.buildRustPackage rec { src = pkgs.zsh-histdb-skim;
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
'';
};
} }
]; ];
}; };