!NhAsaYbbgmzHtXTPQJ:funklause.de

Nix NodeJS

211 Members
62 Servers

Load older messages


SenderMessageTime
23 Jul 2023
@lily:lily.flowersLily Foster
In reply to @gdamjan:spodeli.org
what would be an alternative approach?
buildYarnPackage, whenever we come back to that. It's like next on the list after a few more buildNpmPackage/fetchNpmDeps PRs I have open (see the Node.js team project board)
00:08:12
@lily:lily.flowersLily Foster(there's no major technical blockers, it just needs some time put into it, and we've been dealing with too much real-life nonsense 😭)00:10:06
@sandro:supersandro.deSandro 🐧 joined the room.21:51:42
@sandro:supersandro.deSandro 🐧How do we package things that require yarn berry? Hedgedoc is currently stuck on 1.9.7 because of that and there is soon an urgency to update.21:51:58
@lily:lily.flowersLily FosterIf I get the time and mental bandwidth, I may take a stab at it this week. Right now we have no tooling for it so just generating and vendoring a package-lock.json is unfortunately probably the best solution atm if it still builds fine with npm22:00:40
@me:indeednotjames.comEmily joined the room.22:12:48
@sandro:supersandro.deSandro 🐧then I am probably going that route, we have a security update ahead...22:18:12
24 Jul 2023
@janne.hess:helsinki-systems.deJanne Heß Sandro 🐧: 07:57:33
@janne.hess:helsinki-systems.deJanne Heß * Sandro 🐧: minimally tested, but should do: 07:57:42
@janne.hess:helsinki-systems.deJanne Heß
{ lib
, stdenv
, fetchFromGitHub
, gitMinimal
, cacert
, yarn
, makeBinaryWrapper
, nodejs
, nodePackages
, python3
, nixosTests
}: let

  version = "1.9.8";

  src = fetchFromGitHub {
    owner = "hedgedoc";
    repo = "hedgedoc";
    rev = version;
    sha256 = "sha256-gp1TeYHwH7ffaSMifdURb2p+U8u6Xs4JU4b4qACEIDw=";
  };

  offlineCache = stdenv.mkDerivation {
    name = "hedgedoc-${version}-offline-cache";
    inherit src;

    nativeBuildInputs = [
      cacert # needed for git
      gitMinimal # needed for a dep
      nodePackages.npm # needed for a dep
      yarn
    ];

    HOME = "/build";
    buildPhase = ''
      yarn config set enableTelemetry 0
      yarn config set cacheFolder $out
      yarn
    '';

    outputHashMode = "recursive";
    outputHash = "sha256-4TPc9J9u0rO9WfZVbFWwVAM5WY3n5zJdhIlNYiZNRoM=";
  };

in stdenv.mkDerivation rec {
  pname = "hedgedoc";
  inherit version src;

  nativeBuildInputs = [
    makeBinaryWrapper
    yarn
    python3 # needed for sqlite node-gyp
  ];
  extraBuildInputs = [ python3 ];

  dontConfigure = true;

  HOME = "/build";
  buildPhase = ''
    runHook preBuild

    logHook() {
      cat /build/xfs-*/build.log
    }
    failureHooks+=(logHook)

    yarn config set enableTelemetry 0
    yarn config set cacheFolder ${offlineCache}

    # This will fail but create the sqlite3 files we can patch
    yarn --immutable-cache || :

    # Ensure we don't download any node things
    sed -i 's:--fallback-to-build:--build-from-source --nodedir=${nodejs}/include/node:g' node_modules/sqlite3/package.json
    export CPPFLAGS="-I${nodejs}/include/node"

    # Perform the actual install
    yarn --immutable-cache

    patchShebangs bin/*

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    mkdir -p $out
    cp -R {app.js,bin,lib,locales,node_modules,package.json,public} $out

    makeWrapper ${nodejs}/bin/node $out/bin/hedgedoc \
      --add-flags $out/app.js \
      --set NODE_PATH "$out/lib/node_modules"

    runHook postInstall
  '';

  passthru = {
    tests = { inherit (nixosTests) hedgedoc; };
  };

  meta = with lib; {
    description = "Realtime collaborative markdown notes on all platforms";
    license = licenses.agpl3;
    homepage = "https://hedgedoc.org";
    maintainers = with maintainers; [ SuperSandro2000 ];
    platforms = platforms.linux;
  };
}
07:57:44
@janne.hess:helsinki-systems.deJanne Heß *
{ lib
, stdenv
, fetchFromGitHub
, gitMinimal
, cacert
, yarn
, makeBinaryWrapper
, nodejs
, nodePackages
, python3
, nixosTests
}: let

  version = "1.9.8";

  src = fetchFromGitHub {
    owner = "hedgedoc";
    repo = "hedgedoc";
    rev = version;
    sha256 = "sha256-gp1TeYHwH7ffaSMifdURb2p+U8u6Xs4JU4b4qACEIDw=";
  };

  offlineCache = stdenv.mkDerivation {
    name = "hedgedoc-${version}-offline-cache";
    inherit src;

    nativeBuildInputs = [
      cacert # needed for git
      gitMinimal # needed for a dep
      nodePackages.npm # needed for a dep
      yarn
    ];

    HOME = "/build";
    buildPhase = ''
      yarn config set enableTelemetry 0
      yarn config set cacheFolder $out
      yarn
    '';

    outputHashMode = "recursive";
    outputHash = "sha256-4TPc9J9u0rO9WfZVbFWwVAM5WY3n5zJdhIlNYiZNRoM=";
  };

in stdenv.mkDerivation rec {
  pname = "hedgedoc";
  inherit version src;

  nativeBuildInputs = [
    makeBinaryWrapper
    yarn
    python3 # needed for sqlite node-gyp
  ];
  extraBuildInputs = [ python3 ];

  dontConfigure = true;

  HOME = "/build";
  buildPhase = ''
    runHook preBuild

    logHook() {
      cat /build/xfs-*/build.log
    }
    failureHooks+=(logHook)

    yarn config set enableTelemetry 0
    yarn config set cacheFolder ${offlineCache}

    # This will fail but create the sqlite3 files we can patch
    yarn --immutable-cache || :

    # Ensure we don't download any node things
    sed -i 's:--fallback-to-build:--build-from-source --nodedir=${nodejs}/include/node:g' node_modules/sqlite3/package.json
    export CPPFLAGS="-I${nodejs}/include/node"

    # Perform the actual install
    yarn --immutable-cache

    patchShebangs bin/*

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    mkdir -p $out
    cp -R {app.js,bin,lib,locales,node_modules,package.json,public} $out

    makeWrapper ${nodejs}/bin/node $out/bin/hedgedoc \
      --add-flags $out/app.js \
      --set NODE_PATH "$out/lib/node_modules"

    runHook postInstall
  '';

  passthru = {
    tests = { inherit (nixosTests) hedgedoc; };
  };

  meta = with lib; {
    description = "Realtime collaborative markdown notes on all platforms";
    license = licenses.agpl3;
    homepage = "https://hedgedoc.org";
    maintainers = with maintainers; [ SuperSandro2000 ];
    platforms = platforms.linux;
  };
}
07:57:49
@janne.hess:helsinki-systems.deJanne Heßalso does a real source download rather than taking the precompiled js files07:59:20
@janne.hess:helsinki-systems.deJanne Heß *
{ lib
, stdenv
, fetchFromGitHub
, gitMinimal
, cacert
, yarn
, makeBinaryWrapper
, nodejs
, nodePackages
, python3
, nixosTests
}: let

  version = "1.9.8";

  src = fetchFromGitHub {
    owner = "hedgedoc";
    repo = "hedgedoc";
    rev = version;
    hash = "sha256-gp1TeYHwH7ffaSMifdURb2p+U8u6Xs4JU4b4qACEIDw=";
  };

  offlineCache = stdenv.mkDerivation {
    name = "hedgedoc-${version}-offline-cache";
    inherit src;

    nativeBuildInputs = [
      cacert # needed for git
      gitMinimal # needed for a dep
      nodePackages.npm # needed for a dep
      yarn
    ];

    HOME = "/build";
    buildPhase = ''
      yarn config set enableTelemetry 0
      yarn config set cacheFolder $out
      yarn
    '';

    outputHashMode = "recursive";
    outputHash = "sha256-4TPc9J9u0rO9WfZVbFWwVAM5WY3n5zJdhIlNYiZNRoM=";
  };

in stdenv.mkDerivation rec {
  pname = "hedgedoc";
  inherit version src;

  nativeBuildInputs = [
    makeBinaryWrapper
    yarn
    python3 # needed for sqlite node-gyp
  ];
  extraBuildInputs = [ python3 ];

  dontConfigure = true;

  HOME = "/build";
  buildPhase = ''
    runHook preBuild

    logHook() {
      cat /build/xfs-*/build.log
    }
    failureHooks+=(logHook)

    yarn config set enableTelemetry 0
    yarn config set cacheFolder ${offlineCache}

    # This will fail but create the sqlite3 files we can patch
    yarn --immutable-cache || :

    # Ensure we don't download any node things
    sed -i 's:--fallback-to-build:--build-from-source --nodedir=${nodejs}/include/node:g' node_modules/sqlite3/package.json
    export CPPFLAGS="-I${nodejs}/include/node"

    # Perform the actual install
    yarn --immutable-cache

    patchShebangs bin/*

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    mkdir -p $out
    cp -R {app.js,bin,lib,locales,node_modules,package.json,public} $out

    makeWrapper ${nodejs}/bin/node $out/bin/hedgedoc \
      --add-flags $out/app.js \
      --set NODE_PATH "$out/lib/node_modules"

    runHook postInstall
  '';

  passthru = {
    tests = { inherit (nixosTests) hedgedoc; };
  };

  meta = with lib; {
    description = "Realtime collaborative markdown notes on all platforms";
    license = licenses.agpl3;
    homepage = "https://hedgedoc.org";
    maintainers = with maintainers; [ SuperSandro2000 ];
    platforms = platforms.linux;
  };
}
07:59:53
@sandro:supersandro.deSandro 🐧Minimal as in you deployt it and launched the editor? That broke the last time spectacularly.08:00:14
@sandro:supersandro.deSandro 🐧* Minimal as in you deployed it and launched the editor? That broke the last time spectacularly.08:00:25
@janne.hess:helsinki-systems.deJanne Heßno even more minimal :D it builds and the binary gives the output I expect08:00:37
@janne.hess:helsinki-systems.deJanne Heßlet me see if I can easily run it08:00:41
@sandro:supersandro.deSandro 🐧You can locally start it if it gets some envs, maybe I can dig them up from my shell history later08:01:41
@janne.hess:helsinki-systems.deJanne Heßgot it08:17:08
@janne.hess:helsinki-systems.deJanne Heß The aforementioned error happens when the frontend isn't build (yarn run build) 08:17:22
@janne.hess:helsinki-systems.deJanne HeßI now have a note open and I typed in it08:17:33
@janne.hess:helsinki-systems.deJanne Heß
{ lib
, stdenv
, fetchFromGitHub
, gitMinimal
, cacert
, yarn
, makeBinaryWrapper
, nodejs
, nodePackages
, python3
, nixosTests
}: let

  version = "1.9.8";

  src = fetchFromGitHub {
    owner = "hedgedoc";
    repo = "hedgedoc";
    rev = version;
    sha256 = "sha256-gp1TeYHwH7ffaSMifdURb2p+U8u6Xs4JU4b4qACEIDw=";
  };

  offlineCache = stdenv.mkDerivation {
    name = "hedgedoc-${version}-offline-cache";
    inherit src;

    nativeBuildInputs = [
      cacert # needed for git
      gitMinimal # needed for a dep
      nodePackages.npm # needed for a dep
      yarn
    ];

    HOME = "/build";
    buildPhase = ''
      yarn config set enableTelemetry 0
      yarn config set cacheFolder $out
      yarn
    '';

    outputHashMode = "recursive";
    outputHash = "sha256-4TPc9J9u0rO9WfZVbFWwVAM5WY3n5zJdhIlNYiZNRoM=";
  };

in stdenv.mkDerivation rec {
  pname = "hedgedoc";
  inherit version src;

  nativeBuildInputs = [
    makeBinaryWrapper
    yarn
    python3 # needed for sqlite node-gyp
  ];
  extraBuildInputs = [ python3 ];

  dontConfigure = true;

  HOME = "/build";
  buildPhase = ''
    runHook preBuild

    yarn config set enableTelemetry 0
    yarn config set cacheFolder ${offlineCache}

    # This will fail but create the sqlite3 files we can patch
    yarn --immutable-cache || :

    # Ensure we don't download any node things
    sed -i 's:--fallback-to-build:--build-from-source --nodedir=${nodejs}/include/node:g' node_modules/sqlite3/package.json
    export CPPFLAGS="-I${nodejs}/include/node"

    # Perform the actual install
    yarn --immutable-cache
    yarn run build

    patchShebangs bin/*

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    mkdir -p $out
    cp -R {app.js,bin,lib,locales,node_modules,package.json,public} $out

    makeWrapper ${nodejs}/bin/node $out/bin/hedgedoc \
      --add-flags $out/app.js \
      --set NODE_ENV production \
      --set NODE_PATH "$out/lib/node_modules"

    runHook postInstall
  '';

  passthru = {
    tests = { inherit (nixosTests) hedgedoc; };
  };

  meta = with lib; {
    description = "Realtime collaborative markdown notes on all platforms";
    license = licenses.agpl3;
    homepage = "https://hedgedoc.org";
    maintainers = with maintainers; [ SuperSandro2000 ];
    platforms = platforms.linux;
  };
}
08:17:43
@janne.hess:helsinki-systems.deJanne Heß(also cleaned up the wrapper and added NODE_ENV)08:18:13
@janne.hess:helsinki-systems.deJanne Heß *
{ lib
, stdenv
, fetchFromGitHub
, gitMinimal
, cacert
, yarn
, makeBinaryWrapper
, nodejs
, nodePackages
, python3
, nixosTests
}: let

  version = "1.9.8";

  src = fetchFromGitHub {
    owner = "hedgedoc";
    repo = "hedgedoc";
    rev = version;
    hash = "sha256-gp1TeYHwH7ffaSMifdURb2p+U8u6Xs4JU4b4qACEIDw=";
  };

  offlineCache = stdenv.mkDerivation {
    name = "hedgedoc-${version}-offline-cache";
    inherit src;

    nativeBuildInputs = [
      cacert # needed for git
      gitMinimal # needed for a dep
      nodePackages.npm # needed for a dep
      yarn
    ];

    HOME = "/build";
    buildPhase = ''
      yarn config set enableTelemetry 0
      yarn config set cacheFolder $out
      yarn
    '';

    outputHashMode = "recursive";
    outputHash = "sha256-4TPc9J9u0rO9WfZVbFWwVAM5WY3n5zJdhIlNYiZNRoM=";
  };

in stdenv.mkDerivation rec {
  pname = "hedgedoc";
  inherit version src;

  nativeBuildInputs = [
    makeBinaryWrapper
    yarn
    python3 # needed for sqlite node-gyp
  ];
  extraBuildInputs = [ python3 ];

  dontConfigure = true;

  HOME = "/build";
  buildPhase = ''
    runHook preBuild

    yarn config set enableTelemetry 0
    yarn config set cacheFolder ${offlineCache}

    # This will fail but create the sqlite3 files we can patch
    yarn --immutable-cache || :

    # Ensure we don't download any node things
    sed -i 's:--fallback-to-build:--build-from-source --nodedir=${nodejs}/include/node:g' node_modules/sqlite3/package.json
    export CPPFLAGS="-I${nodejs}/include/node"

    # Perform the actual install
    yarn --immutable-cache
    yarn run build

    patchShebangs bin/*

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    mkdir -p $out
    cp -R {app.js,bin,lib,locales,node_modules,package.json,public} $out

    makeWrapper ${nodejs}/bin/node $out/bin/hedgedoc \
      --add-flags $out/app.js \
      --set NODE_ENV production \
      --set NODE_PATH "$out/lib/node_modules"

    runHook postInstall
  '';

  passthru = {
    tests = { inherit (nixosTests) hedgedoc; };
  };

  meta = with lib; {
    description = "Realtime collaborative markdown notes on all platforms";
    license = licenses.agpl3;
    homepage = "https://hedgedoc.org";
    maintainers = with maintainers; [ SuperSandro2000 ];
    platforms = platforms.linux;
  };
}
08:45:42
@sandro:supersandro.deSandro 🐧 I can take a look later at this, maybe you can already create a PR.
Thanks for digging into this
09:56:34
25 Jul 2023
@federicodschonborn:matrix.orgFederico Damián Schonborn changed their profile picture.01:56:41
@hexa:lossy.networkhexaUh, have we found a solution out of the missing integrity debacle?17:23:57
@hexa:lossy.networkhexa upstream issues seems to be going nowhere17:27:27
@hexa:lossy.networkhexa something like cargoLock.outputHashes would be great 17:28:55
@hexa:lossy.networkhexaI can create an issue, if we want to track this better than me rambling in this room17:29:26

There are no newer messages yet.


Back to Room ListRoom Version: 6