-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
47 lines (47 loc) · 1.58 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
description = "The AstroPlant web front-end";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
outputs = { self, nixpkgs, flake-utils, ... }:
let
version = "0.1.0-alpha.1";
buildString = (builtins.substring 0 8 self.sourceInfo.lastModifiedDate) + "-" + (if (self ? rev) then self.rev else "dirty");
in
{
overlays.default = final: prev: {
astroplant-frontend = final.callPackage ./nix/build.nix { inherit version buildString; };
};
} //
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
in
{
packageExprs.astroplant-frontend = { apiUrl, websocketUrl }:
pkgs.astroplant-frontend.override { inherit apiUrl websocketUrl; };
packages.astroplant-frontend = pkgs.astroplant-frontend;
defaultPackage = self.packages.${system}.astroplant-frontend;
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
bashInteractive
nodejs-18_x
yarn
nodePackages.javascript-typescript-langserver
nodePackages.prettier
jre
coreutils
];
shellHook = ''
# FIXME: this isn't a long-term solution. With an upgrade of react-scripts
# to 5.x it shouldn't be necessary anymore.
export NODE_OPTIONS=--openssl-legacy-provider
'';
};
});
}