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


                                           
                              






                                            
                              












                                           
{ yarnModulesConfig, mkYarnModules', sources, nodejs, stdenv }:
rec {
  modules = mkYarnModules' rec {
    pname = "peertube-server-yarn-modules";
    inherit (sources) version;
    name = "${pname}-${version}";
    packageJSON = "${sources}/package.json";
    yarnLock = "${sources}/yarn.lock";
    pkgConfig = yarnModulesConfig;
  };
  dist = stdenv.mkDerivation {
    pname = "peertube-server";
    inherit (sources) version;
    src = sources;
    buildPhase = ''
      ln -s ${modules}/node_modules .
      patchShebangs scripts/build/server.sh
      npm run build:server
    '';
    installPhase = ''
      mkdir $out
      cp -a dist $out
    '';
    buildInputs = [ nodejs ];
  };
}