ctucx.git: smartie-pwa

[js] smarthome web-gui

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
{ pkgs ? import <nixpkgs> {} }:

let
  modules = pkgs.yarn2nix-moretea.mkYarnPackage {
    src = ./.;
    yarnNix = ./yarn.nix;
  };
in pkgs.stdenv.mkDerivation {
  pname = "smarthome-pwa";
  version = "1.0.0";
  src = ./.;

  buildPhase = ''
    ln -s "${modules}/libexec/smarthome-pwa/node_modules" "node_modules"
    ${pkgs.nodejs-slim}/bin/node node_modules/.bin/rollup -c
  '';

  installPhase = ''
    mkdir -p $out
    cp -r index.html main.min.js manifest.json favicon-512x512.png $out/
  '';
}