-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
40 lines (35 loc) · 1.04 KB
/
flake.nix
File metadata and controls
40 lines (35 loc) · 1.04 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
systems.url = "github:nix-systems/default"; # can run on all systems
};
outputs = { self, nixpkgs, systems, ... }:
let
eachSystem = fn: nixpkgs.lib.genAttrs (import systems) (system: fn system (import nixpkgs {
inherit system;
}));
in
{
packages = eachSystem (system: pkgs: rec {
default = terralux-frontend;
terralux-frontend = pkgs.buildNpmPackage {
name = "terralux-frontend";
src = ./.;
npmDepsHash = "sha256-kUJa63D5A5gJhiGw5JuowIF1vXfB2Aaaxsmpi2z8E0s=";
# runs `npm run build` by default
installPhase = ''
mkdir -p $out/bin/src
cp -r build/* $out/bin/src
makeWrapper "${pkgs.nodejs}/bin/node" "$out/bin/terralux-frontend" \
--add-flags "$out/bin/src" \
--set PORT 4173
'';
};
});
devShells = eachSystem (system: pkgs: {
default = pkgs.mkShell {
nativeBuildInputs = [ pkgs.nodejs ];
};
});
};
}