-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathflake.nix
More file actions
69 lines (63 loc) · 2.34 KB
/
Copy pathflake.nix
File metadata and controls
69 lines (63 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
description = "An environment for creative systems.";
inputs = {
crane.url = "github:ipetkov/crane";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:oxalica/rust-overlay";
};
systems.url = "github:nix-systems/default";
};
outputs =
inputs:
let
overlays = [
inputs.rust-overlay.overlays.default
inputs.self.overlays.default
];
perSystemPkgs =
f:
inputs.nixpkgs.lib.genAttrs (import inputs.systems) (
system: f (import inputs.nixpkgs { inherit overlays system; })
);
in
{
overlays.default = final: prev: {
gantzCraneLib = inputs.crane.mkLib final;
gantzCraneLibWasm = final.gantzCraneLib.overrideToolchain (p: p.rustToolchainWasmNightly);
gantz-unwrapped = prev.callPackage ./pkgs/gantz-unwrapped.nix {
craneLib = final.gantzCraneLib;
};
gantz = final.callPackage ./pkgs/gantz.nix { };
gantz-website = final.callPackage ./pkgs/gantz-website.nix {
craneLib = final.gantzCraneLibWasm;
};
serve-gantz-website = final.callPackage ./pkgs/serve-gantz-website.nix { };
wasm-bindgen-cli = prev.callPackage ./pkgs/wasm-bindgen-cli.nix { };
# Nightly wasm toolchain for the AudioWorklet website build: `-Z build-std`
# (recompiling `std` with atomics for WASM threads) is nightly-only, and
# `rust-src` supplies the `std` sources it rebuilds from.
rustToolchainWasmNightly = final.rust-bin.selectLatestNightlyWith (
toolchain:
toolchain.default.override {
extensions = [ "rust-src" ];
targets = [ "wasm32-unknown-unknown" ];
}
);
};
packages = perSystemPkgs (pkgs: {
gantz = pkgs.gantz;
gantz-website = pkgs.gantz-website;
serve-gantz-website = pkgs.serve-gantz-website;
wasm-bindgen-cli = pkgs.wasm-bindgen-cli;
default = pkgs.gantz;
});
devShells = perSystemPkgs (pkgs: {
gantz-dev = pkgs.callPackage ./shell.nix { };
gantz-web = pkgs.callPackage ./shell-web.nix { };
default = inputs.self.devShells.${pkgs.stdenv.hostPlatform.system}.gantz-dev;
});
formatter = perSystemPkgs (pkgs: pkgs.nixfmt-tree);
};
}