zellij/.nix/plugins.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.2 KiB
Nix
Raw Normal View History

{
pkgs,
root,
cargo,
rustc,
cargoLock,
nativeBuildInputs,
buildInputs,
}: let
ignoreSource = [
".git"
".github"
"docs"
"example"
"target"
".editorconfig"
".envrc"
".git-blame-ignore-revs"
"CHANGELOG.md"
"CODE_OF_CONDUCT.md"
"CONTRIBUTING.md"
"GOVERNANCE.md"
"LICENSE.md"
"docker-compose.yml"
];
src = pkgs.nix-gitignore.gitignoreSource ignoreSource root;
makeDefaultPlugin = name:
(pkgs.makeRustPlatform {inherit cargo rustc;}).buildRustPackage {
inherit
src
name
cargoLock
buildInputs
nativeBuildInputs
;
buildPhase = ''
cargo build --package ${name} --release --target=wasm32-wasi
mkdir -p $out/bin;
#cp target/wasm32-wasi/release/${name}.wasm $out/bin/${name}.wasm
wasm-opt \
-O target/wasm32-wasi/release/${name}.wasm \
-o $out/bin/${name}.wasm
'';
installPhase = ":";
checkPhase = ":";
};
in {
status-bar = makeDefaultPlugin "status-bar";
tab-bar = makeDefaultPlugin "tab-bar";
strider = makeDefaultPlugin "strider";
compact-bar = makeDefaultPlugin "compact-bar";
}