summaryrefslogtreecommitdiff
path: root/overlays/spm/frontend/default.nix
blob: 4470b90c5c22fe66478a0da257c6bac04ac03765 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ lib, nodejs, stdenv, fetchurl, writeText, git, cacert
, python3
, baseHref ? null
}:

let
  project = import ./yarn-project.nix { inherit lib nodejs stdenv fetchurl writeText git cacert; } {
    src = ./.;
  };
in project.overrideAttrs (oldAttrs: {
  name = "spm-frontend";

  buildInputs = (oldAttrs.buildInputs or []) ++ [ python3 ];

  buildPhase = ''
    yarn build ${lib.optionalString (baseHref != null) "--base-href ${baseHref}"}
  '';

  installPhase = ''
    cp -r dist/spm-frontend $out
  '';
})