!NhAsaYbbgmzHtXTPQJ:funklause.de

Nix NodeJS

196 Members
57 Servers

Load older messages


SenderMessageTime
9 Mar 2024
@hexa:lossy.networkhexaI think rsync might be overkill 😄 19:43:04
@kyle:iteratee.net@kyle:iteratee.netBut it's a one-liner.19:43:26
@lily:lily.flowersLily Fosternah, we need to make as many packages have rsync as a build-time reverse dep as possible (/s)19:43:34
@lily:lily.flowersLily Foster * nah, we need to make as many packages have rsync as a build-time reverse deps as possible (/s)19:44:20
@lily:lily.flowersLily Foster
In reply to @lily:lily.flowers
nah, we need to make as many packages have rsync as a build-time reverse deps as possible (/s)
(for context, iirc the last time an rsync bump erroneously went to master instead of staging was because the PR author didn't expect it to have thousands of reverse deps)
19:45:02
@kyle:iteratee.net@kyle:iteratee.netOnce you give up on a one-liner, cp and then chmod has the nice property of being simple and obvious (to a reader)19:45:04
@hexa:lossy.networkhexa
In reply to @kyle:iteratee.net
But it's a one-liner.
yeah, but it increases the closure 🙂
19:50:08
@hexa:lossy.networkhexa
In reply to @kyle:iteratee.net
But it's a one-liner.
* yeah, but it increases the build closure 🙂
19:50:15
@lily:lily.flowersLily Fosterrsync in linux stdenv when19:50:36
@qyriad:katesiria.orgQyriad can't install do this? 19:50:58
@qyriad:katesiria.orgQyriad I can never remember exactly what intersection of functionality install has, but it can copy and set permissions at the same time at least 19:51:22
@lily:lily.flowersLily Foster
In reply to @qyriad:katesiria.org
I can never remember exactly what intersection of functionality install has, but it can copy and set permissions at the same time at least
it needs to be able to ignore some perm bits but keep the execute bits the same (rather than setting a static mode). i forget if it supports that, but if so that would definitely be the best idea
19:52:18
@qyriad:katesiria.orgQyriadI don't see it in the man page 😔19:54:26
@kyle:iteratee.net@kyle:iteratee.netI think you can use find to locate things by their permissions. You could use that along with `--no-preserve=mode` to add back +x bits.19:58:04
@kyle:iteratee.net@kyle:iteratee.net(find things in source with +x bits and then arrange to chmod the same thing in destination)19:59:13
@qyriad:katesiria.orgQyriadwe're getting back to "might as well just use rsync" territory though19:59:58
@qyriad:katesiria.orgQyriador like, a python script20:00:03
10 Mar 2024
@kstiehl:matrix.numericas.de@kstiehl:matrix.numericas.de left the room.08:59:57
11 Mar 2024
@szucsitg:matrix.orgszucsitg
In reply to @adis:blad.is
https://github.com/NixOS/nixpkgs/pull/289231
Is there any reason behind the missing linkNodeModulesHook in this PR comparing to your source repo?
20:41:26
14 Mar 2024
@federicodschonborn:matrix.org@federicodschonborn:matrix.org left the room.02:04:35
@countoren:matrix.orgcountoren changed their display name from oren to countoren.14:09:42
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.deIs there a way to get from a set of .tgz files to a proper npm cache?15:13:41
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.de I tried just mapping them over fetchurl and then npm cache add but that breaks prefetch-npm-deps for some reason (Error: invalid value: integer 1710428006885, expected u8 at line 1 column 223) 15:14:15
@lily:lily.flowersLily Foster
In reply to @janne.hess:helsinki-systems.de
I tried just mapping them over fetchurl and then npm cache add but that breaks prefetch-npm-deps for some reason (Error: invalid value: integer 1710428006885, expected u8 at line 1 column 223)
can you share code?
16:21:11
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.de
In reply to @lily:lily.flowers
can you share code?

Sure:

  passthru.frontend = buildNpmPackage rec { # TODO not rec
    pname = "elma-frontend";
    inherit version;
    src = ~/projects/test; #TODO inherit
    npmDeps = stdenvNoCC.mkDerivation {
      pname = "frontend-npm-cache";
      inherit version src;
      strictDeps = true;
      __structuredAttrs = true;

      dontPatch = true;
      dontConfigure = true;

      tars = lib.mapAttrsToList (_: v: fetchurl {
          url = v.resolved;
          hash = v.integrity;
        }) (lib.filterAttrs (_: v: v ? "resolved" && v ? "integrity")
            (builtins.fromJSON (builtins.readFile "${src}/package-lock.json")).packages
        );
      buildPhase = ''
        export HOME=/build
        npm config set cache "$out"
        for tar in "''${tars[@]}"; do
          echo "Adding $(stripHash "$tar") to npm cache"
          npm cache add "$tar"
        done
        cp package-lock.json "$out"
      '';
      dontInstall = true;

      nativeBuildInputs = [ nodePackages.npm cacert nodejs nukeReferences ];

      #outputHashMode = "recursive";
      #outputHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
    };
  };
}
16:36:21
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.deplease don't tell me it's ugly, I already know ;)16:36:30
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.de
In reply to @lily:lily.flowers
can you share code?
*

Sure:

  passthru.frontend = buildNpmPackage rec { # TODO not rec
    pname = "frontend";
    inherit version;
    src = ~/projects/test; #TODO inherit
    npmDeps = stdenvNoCC.mkDerivation {
      pname = "frontend-npm-cache";
      inherit version src;
      strictDeps = true;
      __structuredAttrs = true;

      dontPatch = true;
      dontConfigure = true;

      tars = lib.mapAttrsToList (_: v: fetchurl {
          url = v.resolved;
          hash = v.integrity;
        }) (lib.filterAttrs (_: v: v ? "resolved" && v ? "integrity")
            (builtins.fromJSON (builtins.readFile "${src}/package-lock.json")).packages
        );
      buildPhase = ''
        export HOME=/build
        npm config set cache "$out"
        for tar in "''${tars[@]}"; do
          echo "Adding $(stripHash "$tar") to npm cache"
          npm cache add "$tar"
        done
        cp package-lock.json "$out"
      '';
      dontInstall = true;

      nativeBuildInputs = [ nodePackages.npm cacert nodejs nukeReferences ];

      #outputHashMode = "recursive";
      #outputHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
    };
  };
}
16:36:34
@lily:lily.flowersLily Foster
In reply to @janne.hess:helsinki-systems.de
please don't tell me it's ugly, I already know ;)
i get it, no worries :)
16:36:59
@lily:lily.flowersLily Fosteri'll take a look when i get a chance. am at nixcon this morning16:37:08
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.de
In reply to @lily:lily.flowers
i'll take a look when i get a chance. am at nixcon this morning
Thank you and enjoy :)
16:47:24

Show newer messages


Back to Room ListRoom Version: 6