fix: fix nix build (#24)

* fix: fix nix build

* feat: automatically prefix ANYRUN_PLUGINS with the nix store
This commit is contained in:
Michał
2023-05-02 19:51:46 +02:00
committed by GitHub
parent 9fed55e692
commit 599fc1d44d
4 changed files with 18 additions and 76 deletions

View File

@@ -1,10 +1,9 @@
# default.nix
{
lib,
naersk,
glib,
targetPlatform,
makeWrapper,
rustPlatform,
atk,
gtk3,
gtk-layer-shell,
@@ -16,7 +15,7 @@
}: let
cargoToml = builtins.fromTOML (builtins.readFile ./anyrun/Cargo.toml);
in
naersk.lib."${targetPlatform.system}".buildPackage {
rustPlatform.buildRustPackage {
src = ./.;
buildInputs = [
@@ -27,9 +26,18 @@ in
librsvg
gtk-layer-shell
];
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"kidex-common-0.1.0" = "sha256-sPzCTK0gdIYkKWxrtoPJ/F2zrG2ZKHOSmANW2g00fSQ=";
};
};
checkInputs = [cargo rustc];
nativeBuildInputs = [
pkg-config
makeWrapper
rustfmt
rustc
@@ -46,7 +54,8 @@ in
postInstall = ''
wrapProgram $out/bin/anyrun \
--set GDK_PIXBUF_MODULE_FILE "$(echo ${librsvg.out}/lib/gdk-pixbuf-2.0/*/loaders.cache)"
--set GDK_PIXBUF_MODULE_FILE "$(echo ${librsvg.out}/lib/gdk-pixbuf-2.0/*/loaders.cache)" \
--prefix ANYRUN_PLUGINS : $out/lib
'';
meta = with lib; {