| 22 Oct 2023 |
Cobalt | * 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 |
Cobalt | * 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 | 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? | 12:43:48 |
Lily 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 |
| Federico Damián Schonborn changed their profile picture. | 00:12:27 |
@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 Foster | what do you mean root access problem? | 13:55:07 |
@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 | Lily Foster I'm getting the sharp binary root error. | 13:55:32 |
@ThorHop:matrix.org | or EACCESS: permission denied, mkdir '/nix/store/blablabla-package-npm-deps/_libvips' | 13:56:17 |
Lily Foster | oh 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 failure | 13:56:25 |
Lily 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 Foster | it's never going to be able to write to a nix store path. they're read-only even for root | 13:57:09 |
Lily Foster | except for the outputs/$out for the current derivation, of course | 13:57:29 |
@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 Foster | okay yeah it's trying to download sharp instead of build it | 14:00:04 |
Lily Foster | you have nativeBuildInputs = [ python3 pkg-config ]; buildInputs = [ vips ]; in your buildNpmPackage call? | 14:00:43 |
@ThorHop:matrix.org | with pkgs; | 14:01:54 |
@ThorHop:matrix.org | but yes | 14:02:06 |
Lily Foster | can you share your whole derivation then? | 14:02:21 |
@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 | ehr... that last installPhase needs updating ^^; | 14:03:21 |
Lily Foster | can you share your package.json and package-lock.json too? Or maybe the repo if it's public? | 14:03:23 |
Lily Foster | just so i can poke | 14:04:01 |
@ThorHop:matrix.org | Sure ^^; haven't released it on git, so bear with the codespam: | 14:04:15 |
@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 | That's a lot of cruft -.-; | 14:05:14 |
@ThorHop:matrix.org | Wondering 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 | I 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 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 |