Files
anyrun/nix/default.nix
NotAShelf 099e1a08fd nix: rewrite nix flake from ground up and introduce home-manager module (#44)
* rewrite nix flake and move default package

* revert: remove .envrc

* feat: create home-manager module

big W

* fix: properly parse null for config.plugins

* build plugins from template derivation

* build plugins from template derivation

* cache each plugin individually

* pass name and derivation to template derivation

* fix: rework the devShell

* fix: add missing flake-parts input

* feat: make anyrun not build plugins

it only builds plugins on the anyrun-with-all-plugins package

* chore: write documentation about HM module

* fix: specify pname for plugins

* nix: flake-parts follows nixpkgs

* nix: formatting via alejandra

---------

Co-authored-by: n3oney <neo@neoney.dev>
2023-06-21 18:49:10 +03:00

84 lines
1.6 KiB
Nix

{
lib,
glib,
makeWrapper,
rustPlatform,
atk,
gtk3,
gtk-layer-shell,
pkg-config,
librsvg,
rustfmt,
cargo,
rustc,
lockFile,
dontBuildPlugins ? true,
...
}: let
cargoToml = builtins.fromTOML (builtins.readFile ../anyrun/Cargo.toml);
in
rustPlatform.buildRustPackage rec {
name = cargoToml.package.name;
pname = "anyrun";
#inherit version;
src = ../.;
buildInputs = [
pkg-config
glib
atk
gtk3
librsvg
gtk-layer-shell
];
cargoLock = {
lockFile = lockFile;
};
checkInputs = [cargo rustc];
nativeBuildInputs = [
pkg-config
makeWrapper
rustfmt
rustc
cargo
];
cargoBuildFlags =
if dontBuildPlugins
then ["-p ${name}"]
else [];
doCheck = true;
CARGO_BUILD_INCREMENTAL = "false";
RUST_BACKTRACE = "full";
copyLibs = true;
postInstall = ''
wrapProgram $out/bin/anyrun \
--set GDK_PIXBUF_MODULE_FILE "$(echo ${librsvg.out}/lib/gdk-pixbuf-2.0/*/loaders.cache)" \
--prefix ANYRUN_PLUGINS : $out/lib
'';
meta = with lib; {
description = "A wayland native, highly customizable runner.";
homepage = "https://github.com/Kirottu/anyrun";
license = with licenses; [gpl3];
maintainers = [
{
email = "neo@neoney.dev";
github = "n3oney";
githubId = 30625554;
name = "Michał Minarowski";
}
{
email = "raf@notashelf.dev";
github = "NotAShelf";
}
];
};
}