aboutsummaryrefslogtreecommitdiff
path: root/front.nix
blob: 62fab403fddee203f76fc5cd0858caacbbd866a8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{ pkgs ? import <nixpkgs> {} }:
  let
    nodeDependencies = (pkgs.callPackage ./front/default.nix {}).nodeDependencies;
    stdenv = pkgs.stdenv;
    nodejs = pkgs.nodejs;
    tsc = pkgs.typescript;
  in

  stdenv.mkDerivation {
    name = "duckonaut.dev-front";
    src = ./front;
    buildInputs = [nodejs tsc];
    buildPhase = ''
      ln -s ${nodeDependencies}/lib/node_modules ./node_modules
      export PATH="${nodeDependencies}/bin:$PATH"

      npm run build
      cp -r dist $out/
    '';
  }