aboutsummaryrefslogtreecommitdiff
path: root/flakes/peertube/client.nix
blob: 1501574c1fa57618b7ee0446e75265d98f6c9df0 (plain) (blame)
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
{ yarnModulesConfig, mkYarnModules', server, sources, nodejs, stdenv }:
rec {
  modules = mkYarnModules' rec {
    pname = "peertube-client-yarn-modules";
    inherit (sources) version;
    name = "${pname}-${version}";
    packageJSON = "${sources}/client/package.json";
    yarnLock = "${sources}/client/yarn.lock";
    pkgConfig = yarnModulesConfig;
  };
  dist = stdenv.mkDerivation {
    pname = "peertube-client";
    inherit (sources) version;
    src = sources;
    buildPhase = ''
          ln -s ${server.modules}/node_modules .
          cp -a ${modules}/node_modules client/
          chmod -R +w client/node_modules
          patchShebangs .
          npm run build:client
    '';
    installPhase = ''
          mkdir $out
          cp -a client/dist $out
    '';
    buildInputs = [ nodejs ];
  };
}