!NhAsaYbbgmzHtXTPQJ:funklause.de

Nix NodeJS

208 Members
59 Servers

Load older messages


SenderMessageTime
22 Oct 2023
@c0ba1t:matrix.orgCobalt *

Update: Got it solved via patching the dependency link rather than updating the prefetcher dir:

{
            prePatch = ''
              sed -Ei 's/\.\.\/types\/\*/${
                lib.strings.escape [ "/" "+" "*" "?" "(" ")" "[" "]" ]
                (toString proofbuddy)
              }\/types\/\*/' tsconfig.json
            '';
}

21:44:34
@c0ba1t:matrix.orgCobalt *

Edit: Got it solved via patching the dependency link rather than updating the prefetcher dir:

{
            prePatch = ''
              sed -Ei 's/\.\.\/types\/\*/${
                lib.strings.escape [ "/" "+" "*" "?" "(" ")" "[" "]" ]
                (toString proofbuddy)
              }\/types\/\*/' tsconfig.json
            '';
}

21:46:55
24 Oct 2023
@daniel:nopemail.orgdanielI'm looking into this now, and I like the idea of a hook here. I'm not too familiar with hooks, so do you have any pointers to where to start?12:43:48
@lily:lily.flowersLily Foster
In reply to @daniel:nopemail.org
I'm looking into this now, and I like the idea of a hook here. I'm not too familiar with hooks, so do you have any pointers to where to start?
i mean the simplest would be to just add something like runHook preNpmRebuild in between those lines. But i'm not admittedly sure what the most intelligent way to handle it would be (and welcome input)
12:45:27
25 Oct 2023
@federicodschonborn:matrix.orgFederico Damián Schonborn changed their profile picture.00:12:27
@ThorHop:matrix.org@ThorHop:matrix.org Lily Foster So remember that problem with vips and using pkg-config? I'm not sure, but I think that calling the npm-package.nix file (which just contains the npmBuildPackage function) I get the err root access problem again. I'm wondering if it would be a good idea to just shoehorn in a chown root:root -r *.* && npm run build into the bpmBuild flag... 13:54:41
@lily:lily.flowersLily Fosterwhat do you mean root access problem?13:55:07
@ThorHop:matrix.org@ThorHop:matrix.org I've also called the build from a callPackage function, not sure if that's.. the best idea 13:55:11
@ThorHop:matrix.org@ThorHop:matrix.org Lily Foster I'm getting the sharp binary root error. 13:55:32
@ThorHop:matrix.org@ThorHop:matrix.orgor EACCESS: permission denied, mkdir '/nix/store/blablabla-package-npm-deps/_libvips'13:56:17
@lily:lily.flowersLily Fosteroh i guess it may return a spurious perm error when the dep fails to build. it's not anything to do with root access though and the core problem is the build failure13:56:25
@lily:lily.flowersLily Foster
In reply to @ThorHop:matrix.org
or EACCESS: permission denied, mkdir '/nix/store/blablabla-package-npm-deps/_libvips'
you can makeCacheWritable = true on the buildNpmPackage if it needs to write to the cache
13:56:50
@lily:lily.flowersLily Fosterit's never going to be able to write to a nix store path. they're read-only even for root13:57:09
@lily:lily.flowersLily Fosterexcept for the outputs/$out for the current derivation, of course13:57:29
@ThorHop:matrix.org@ThorHop:matrix.org Great! one step further. Now I'm getting the error "npm ERR! sharp: Installation error: getaddrinfo EAI_AGAIN github.com"... not sure if that's because I'm using nixos-rebuild --target-host.. works fine locally ^^; 13:59:26
@lily:lily.flowersLily Fosterokay yeah it's trying to download sharp instead of build it14:00:04
@lily:lily.flowersLily Foster you have nativeBuildInputs = [ python3 pkg-config ]; buildInputs = [ vips ]; in your buildNpmPackage call? 14:00:43
@ThorHop:matrix.org@ThorHop:matrix.orgwith pkgs;14:01:54
@ThorHop:matrix.org@ThorHop:matrix.orgbut yes14:02:06
@lily:lily.flowersLily Fostercan you share your whole derivation then?14:02:21
@ThorHop:matrix.org@ThorHop:matrix.org
{ pkgs, buildNpmPackage, lib, pkg-config, ... }:

buildNpmPackage {
  name = "gjenge-innleder";
  src = ./.;
  npmDepsHash = "sha256-0Xl7/rSVeUVXczy6fjB5tM9l3d2i38JbUx04UZvwFok=";

  nativeBuildInputs = with pkgs; [python3 pkg-config];
  buildInputs = with pkgs; [vips];
  makeCacheWritable = true;

  installPhase = ''
    mkdir -p $out/srv/htdoc/www
    cp -f -R dist/* $out/srv/htdoc/www
  '';
}
14:02:56
@ThorHop:matrix.org@ThorHop:matrix.orgehr... that last installPhase needs updating ^^;14:03:21
@lily:lily.flowersLily Fostercan you share your package.json and package-lock.json too? Or maybe the repo if it's public?14:03:23
@lily:lily.flowersLily Fosterjust so i can poke14:04:01
@ThorHop:matrix.org@ThorHop:matrix.orgSure ^^; haven't released it on git, so bear with the codespam:14:04:15
@ThorHop:matrix.org@ThorHop:matrix.org

Package.json:

{
  "name": "innleder",
  "type": "module",
  "version": "0.0.1",
  "scripts": {
    "dev": "astro dev",
    "start": "astro dev",
    "build": "astro build",
    "preview": "astro preview",
    "astro": "astro"
  },
  "dependencies": {
    "@astrojs/tailwind": "^5.0.2",
    "astro": "^3.2.4",
    "tailwindcss": "^3.3.3"
  }
}
14:04:26
@ThorHop:matrix.org@ThorHop:matrix.org That's a lot of cruft -.-; 14:05:14
@ThorHop:matrix.org@ThorHop:matrix.orgWondering if there's a smarter way to package static nodejs files for NixOS than pulling in the entire nodejs build stack, but the concept of having both system packaging and nodejs packaging tested in the same process does appeal to me.14:05:44
@ThorHop:matrix.org@ThorHop:matrix.orgI mean it is kinda redonculous since I only want to distribute the static files as a package so I can refer to a store path in nix configs.14:07:08
@lily:lily.flowersLily Foster
In reply to @ThorHop:matrix.org

Package.json:

{
  "name": "innleder",
  "type": "module",
  "version": "0.0.1",
  "scripts": {
    "dev": "astro dev",
    "start": "astro dev",
    "build": "astro build",
    "preview": "astro preview",
    "astro": "astro"
  },
  "dependencies": {
    "@astrojs/tailwind": "^5.0.2",
    "astro": "^3.2.4",
    "tailwindcss": "^3.3.3"
  }
}
Lockfile too?
14:08:58

Show newer messages


Back to Room ListRoom Version: 6