!NhAsaYbbgmzHtXTPQJ:funklause.de

Nix NodeJS

199 Members
57 Servers

Load older messages


SenderMessageTime
9 Mar 2024
@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.orgFederico Damián Schonborn 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
@mjolnir:nixos.orgNixOS Moderation Botchanged room power levels.18:45:37
@felixfahrbahn:matrix.orgfelixfahrbahn joined the room.20:08:33
@felixfahrbahn:matrix.orgfelixfahrbahn Hi, there. QuickQuestion: I package a bash script that uses npm list -g to check whether a module is present (they are loadable with node in nix-shell --pure). I used (nodePackages.node2nix.override { input = "${src}/package.json"; composition = "${src}/node-composition.nix"; }) as a buildInput. I tried with NPM_CONFIG_PREFIX but actually the modules exist only as .tgz in my nixstore. 20:09:48
15 Mar 2024
@grahamc:nixos.org@grahamc:nixos.org joined the room.23:27:44
16 Mar 2024
@hexa:lossy.networkhexa
In reply to @kyle:iteratee.net
I have a PR open for pnpm2nix-nzbr that supports multi-component workspaces with pnpm.
where?
04:21:47
@kyle:iteratee.net@kyle:iteratee.net
In reply to @hexa:lossy.network
where?
https://github.com/nzbr/pnpm2nix-nzbr/pull/35
04:24:15
@hexa:lossy.networkhexaok, but that will never go into nixpkgs, will it?04:24:34
@kyle:iteratee.net@kyle:iteratee.net🤷‍♂️04:24:59
@jee_mj:matrix.orgmj joined the room.14:00:41
18 Mar 2024
@saggins:matrix.orgsaggins joined the room.03:01:32
@emma:rory.gayEmma [it/its] not sure which room this is but it broke (CC hexa) 22:38:43
@emma:rory.gayEmma [it/its]Screenshot from 2024-03-18 23-38-49.png
Download Screenshot from 2024-03-18 23-38-49.png
22:38:58
@hexa:lossy.networkhexalots of rooms are unfortunatly broken like that22:43:02
@emma:rory.gayEmma [it/its]in the case of the main room, it was those events being explicitly redacted, not sure that's the case here aswell22:43:36
19 Mar 2024
@mjolnir:nixos.orgNixOS Moderation Botchanged room power levels.00:31:02
@admin:nixos.org@admin:nixos.org joined the room.14:55:19

Show newer messages


Back to Room ListRoom Version: 6