Add an overlay to the flake.
Some checks failed
foreign-document-test Build foreign-document-test has started
rust-test Build rust-test has started
format Build format has succeeded
clippy Build clippy has failed
build Build build has succeeded

This commit is contained in:
Tom Alexander
2026-07-10 20:21:38 -04:00
parent 656e26e26f
commit de6739f9b6

View File

@@ -57,11 +57,45 @@
pkgs = import nixpkgs {
inherit system overlays;
};
appliedOverlay = self.overlays.default pkgs pkgs;
in
rec {
default = all;
all = pkgs.symlinkJoin {
name = "all";
paths = [
library
devTools
wasm_bundler
wasm_web
];
};
inherit (appliedOverlay.organic)
library
devTools
wasm_bundler
wasm_web
;
docker_env = pkgs.buildEnv {
name = "organic";
paths = with pkgs; [
appliedOverlay.organic.devTools
bash
uutils-coreutils-noprefix
# toybox # Smaller than uutils-coreutils?
];
};
}
);
overlays.default = final: prev: {
organic = final.lib.makeScope final.newScope (
organicScope:
let
build_wasm =
{
bindgenTarget ? null,
}:
(pkgs.callPackage ./nix/package.nix {
(organicScope.callPackage ./nix/package.nix {
targetBins = [
"wasm"
];
@@ -73,7 +107,7 @@
old:
let
bindgen_command = [
"${pkgs.wasm-bindgen-cli}/bin/wasm-bindgen"
"${final.wasm-bindgen-cli}/bin/wasm-bindgen"
"--target"
bindgenTarget
"--out-dir"
@@ -83,7 +117,7 @@
in
{
postBuild = ''
${pkgs.lib.escapeShellArgs bindgen_command}
${final.lib.escapeShellArgs bindgen_command}
'';
installPhase = ''
@@ -93,17 +127,8 @@
}
);
in
rec {
all = pkgs.symlinkJoin {
name = "all";
paths = [
library
devTools
wasm_bundler
wasm_web
];
};
library = (pkgs.callPackage ./nix/package.nix { buildLib = true; }).overrideAttrs (
{
library = (organicScope.callPackage ./nix/package.nix { buildLib = true; }).overrideAttrs (
old:
let
in
@@ -114,7 +139,7 @@
'';
}
);
devTools = pkgs.callPackage ./nix/package.nix {
devTools = organicScope.callPackage ./nix/package.nix {
targetBins = [
"parse"
"compare"
@@ -123,17 +148,8 @@
};
wasm_bundler = build_wasm { bindgenTarget = "bundler"; };
wasm_web = build_wasm { bindgenTarget = "web"; };
docker_env = pkgs.buildEnv {
name = "organic";
paths = with pkgs; [
devTools
bash
uutils-coreutils-noprefix
# toybox # Smaller than uutils-coreutils?
];
};
default = all;
}
);
};
};
}