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:
NotAShelf
2023-06-21 18:49:10 +03:00
committed by GitHub
parent eeb151a542
commit 099e1a08fd
7 changed files with 512 additions and 84 deletions

49
nix/plugins/default.nix Normal file
View 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];
};
}