mirror of
https://github.com/zellij-org/zellij.git
synced 2024-11-23 08:57:14 +03:00
bc44a77f1c
* add: plugins to nix builds * chore(fmt): treefmt
54 lines
1.1 KiB
Nix
54 lines
1.1 KiB
Nix
{
|
|
pkgs,
|
|
root,
|
|
cargo,
|
|
rustc,
|
|
cargoLock,
|
|
nativeBuildInputs,
|
|
buildInputs,
|
|
}: let
|
|
ignoreSource = [
|
|
".git"
|
|
".github"
|
|
"assets"
|
|
"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";
|
|
}
|