-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
33 lines (29 loc) · 1.06 KB
/
flake.nix
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
{
description = "Nix JavaScript transpiler and interpreter.";
inputs.nixpkgs.url = "nixpkgs/nixpkgs-unstable";
inputs.nixjs-rt.url = "github:urbas/nixjs-rt";
outputs = { self, nixpkgs, nixjs-rt }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
forSupportedSystems = f: with nixpkgs.lib; foldl' (resultAttrset: system: recursiveUpdate resultAttrset (f { inherit system; pkgs = import nixpkgs { inherit system; }; })) { } supportedSystems;
in
forSupportedSystems ({ pkgs, system, ... }:
let
buildInputs = with pkgs; [
nixjs-rt.packages.${system}.default
nixpkgs-fmt
rustup
];
in
{
packages.${system} = { inherit nixjs-rt pkgs; };
devShells.${system}.default = pkgs.stdenv.mkDerivation {
name = "nixjs";
inherit buildInputs;
shellHook = ''
export NIXJS_RT_MODULE=${nixjs-rt.packages.${system}.default}/lib/node_modules/nixjs-rt/dist/lib.js
export RUSTFLAGS=-Dwarnings
'';
};
});
}