!NhAsaYbbgmzHtXTPQJ:funklause.de

Nix NodeJS

208 Members
58 Servers

Load older messages


SenderMessageTime
8 Aug 2023
@lily:lily.flowersLily FosterSo that you can poke at the same thing I am if you want, I just pushed to https://github.com/lilyinstarlight/nixpkgs/tree/tmp/marp22:41:45
@lily:lily.flowersLily FosterFor 3.2.022:41:48
@lily:lily.flowersLily FosterWith the upstream lockfile I directly curl'd22:41:55
@lily:lily.flowersLily Foster github:lilyinstarlight/nixpkgs/tmp/marp#marp-cli if you wanted to build it from flake uri 22:43:32
@lily:lily.flowersLily FosterHmmm I think this might be a yarn2nix bug22:44:13
@lily:lily.flowersLily Foster I'm gonna try it using fetchYarnDeps and mkDerivation instead of mkYarnPackage and see what it does 22:44:29
@lily:lily.flowersLily FosterYeah this is 100% a yarn2nix bug. I just built marp-cli without it just fine22:53:42
@lily:lily.flowersLily Foster

Guillaume Desforges: For the record, here's the derivation I wrote that seems to work:

{ lib
, stdenv
, fetchFromGitHub
, fetchYarnDeps
, makeWrapper
, nodejs
, prefetch-yarn-deps
, yarn
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "marp-cli";
  version = "3.2.0";

  src = fetchFromGitHub {
    owner = "marp-team";
    repo = "marp-cli";
    rev = "v${finalAttrs.version}";
    hash = "sha256-bx5mq5KI85qUct/9Hr6mby6dWmRkmpVbiIw+M8PZas8=";
  };

  offlineCache = fetchYarnDeps {
    yarnLock = "${finalAttrs.src}/yarn.lock";
    hash = "sha256-BogCt7ezmWxv2YfhljHYoBf47/FHR0qLZosjnoQhqgs=";
  };

  nativeBuildInputs = [
    makeWrapper
    nodejs
    prefetch-yarn-deps
    yarn
  ];

  configurePhase = ''
    runHook preConfigure

    export HOME=$(mktemp -d)
    yarn config --offline set yarn-offline-mirror $offlineCache
    fixup-yarn-lock yarn.lock
    yarn --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive install
    patchShebangs node_modules

    runHook postConfigure
  '';

  buildPhase = ''
    runHook preBuild

    yarn --offline build

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    yarn --offline --production install

    mkdir -p $out/lib/node_modules/@marp-team/marp-cli
    cp -r lib node_modules marp-cli.js $out/lib/node_modules/@marp-team/marp-cli/

    makeWrapper "${nodejs}/bin/node" "$out/bin/marp" \
      --add-flags "$out/lib/node_modules/@marp-team/marp-cli/marp-cli.js"

    runHook postInstall
  '';

  meta = with lib; {
    description = "About A CLI interface for Marp and Marpit based converters";
    homepage = "https://github.com/marp-team/marp-cli";
    license = licenses.mit;
    maintainers = with maintainers; [ GuillaumeDesforges ];
    platforms = nodejs.meta.platforms;
  };
})
23:05:04
@lily:lily.flowersLily FosterFeel free to steal that entirely. I don't much want to invest more work in yarn2nix than I have to23:05:16
@lily:lily.flowersLily Foster That does basically the same thing buildYarnPackage will when it's done 23:05:25
@gdesforges:matrix.org@gdesforges:matrix.orgWell thank you! It's 1am over here so it'll have to wait tomorrow, but I'll look into it for sure!23:08:59
@lily:lily.flowersLily FosterRest wlel!23:09:18
@lily:lily.flowersLily Foster * Rest well!23:09:19
@gdesforges:matrix.org@gdesforges:matrix.orgThank you so much for your dedication 23:09:28
@gdesforges:matrix.org@gdesforges:matrix.orgLet me know if there is a way to pay you a tip/coffee:)23:09:43
@lily:lily.flowersLily FosterYeah, happy to help. Apologies it took me this long to have the time/bandwidth to dig into it 😅23:09:45
@gdesforges:matrix.org@gdesforges:matrix.org* Let me know if there is a way to pay you a tip/coffee :)23:09:50
@lily:lily.flowersLily Foster
In reply to @gdesforges:matrix.org
Let me know if there is a way to pay you a tip/coffee :)
I mean I do have liberapay and ko-fi both set up now, but don't feel pressured to (I would of course always appreciate coffee though...)
23:10:49
@gdesforges:matrix.org@gdesforges:matrix.orgI wouldn't ask if I felt pressured23:13:14
@janik0:matrix.org@janik0:matrix.org joined the room.23:14:34
@countoren:matrix.orgcountoren

hi guys I actually took couple of branches here:
buildNpmPackage - could not pass the 401 of the fortawosme package, what will be the way to go with the pre-downloaded tars here?
node2nix - override sources in node-packages with the tars i downloaded with npm pack, but now I reached another block that when I overriding the package drv and adding postInstall and buildInputs for ng I am getting : ``` Error: Could not find the '@angular-devkit/build-angular:browser' builder's node package.


23:48:51
@countoren:matrix.orgcountoren *

hi guys I actually took couple of branches here:
buildNpmPackage - could not pass the 401 of the fortawosme package, what will be the way to go with the pre-downloaded tars here?
node2nix - override sources in node-packages with the tars i downloaded with npm pack, but now I reached another block that when I overriding the package drv and adding postInstall and buildInputs for ng I am getting :

Error: Could not find the '@angular-devkit/build-angular:browser' builder's node package.

23:49:33
@countoren:matrix.orgcountoren *

hi guys I actually took couple of branches here:
buildNpmPackage - could not pass the 401 of the fortawosme package, what will be the way to go with the pre-downloaded tars here?
node2nix - override sources in node-packages with the tars i downloaded with npm pack, but now I reached another block that when I overriding the package drv and adding postInstall and buildInputs for ng I am getting :

Error: Could not find the '@angular-devkit/build-angular:browser' builder's node package.
23:50:01
@lily:lily.flowersLily FosterI think this is something we could support in buildNpmPackage without much work. I can provide guidance if you want to add that (shouldn't need much besides adding a header to the fetcher code based on an env var and possibly adding it as a impure env var on the fetcher derivation)23:51:50
@lily:lily.flowersLily FosterIf you want me to get to it in the next week or two, open a github issue and ping me. It really shouldn't take long to implement :)23:52:27
@countoren:matrix.orgcountorensure I could loom into it23:53:39
@countoren:matrix.orgcountorenlook23:53:43
@countoren:matrix.orgcountorenwhat will be the correct way with buildNpmPackage to use ng?23:54:22
@countoren:matrix.orgcountorenstraight buildInputs?23:55:05
@lily:lily.flowersLily Foster nativeBuildInputs, but yeah probably. I never used angular/ng so I know nothing about it really 23:57:25

Show newer messages


Back to Room ListRoom Version: 6