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>
This commit is contained in:
49
nix/plugins/default.nix
Normal file
49
nix/plugins/default.nix
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
lib,
|
||||
glib,
|
||||
makeWrapper,
|
||||
rustPlatform,
|
||||
atk,
|
||||
gtk3,
|
||||
gtk-layer-shell,
|
||||
pkg-config,
|
||||
librsvg,
|
||||
inputs,
|
||||
name,
|
||||
lockFile,
|
||||
...
|
||||
}: let
|
||||
cargoToml = builtins.fromTOML (builtins.readFile ../../plugins/${name}/Cargo.toml);
|
||||
in
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = name;
|
||||
name = cargoToml.package.name;
|
||||
|
||||
src = "${inputs.self}";
|
||||
cargoLock.lockFile = lockFile;
|
||||
|
||||
buildInputs = [
|
||||
glib
|
||||
atk
|
||||
gtk3
|
||||
librsvg
|
||||
gtk-layer-shell
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
CARGO_BUILD_INCREMENTAL = "false";
|
||||
RUST_BACKTRACE = "full";
|
||||
copyLibs = true;
|
||||
cargoBuildFlags = ["-p ${name}"];
|
||||
|
||||
meta = with lib; {
|
||||
description = "The ${name} plugin for Anyrun";
|
||||
homepage = "https://github.com/Kirottu/anyrun";
|
||||
license = with licenses; [gpl3];
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user