aboutsummaryrefslogblamecommitdiff
path: root/flakes/peertube/client.nix
blob: 1501574c1fa57618b7ee0446e75265d98f6c9df0 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
                                                                       


                                           
                              






                                                   
                              














                                                
{ 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 ];
  };
}