| 8 Aug 2023 |
Lily Foster | So that you can poke at the same thing I am if you want, I just pushed to https://github.com/lilyinstarlight/nixpkgs/tree/tmp/marp | 22:41:45 |
Lily Foster | For 3.2.0 | 22:41:48 |
Lily Foster | With the upstream lockfile I directly curl'd | 22:41:55 |
Lily Foster | github:lilyinstarlight/nixpkgs/tmp/marp#marp-cli if you wanted to build it from flake uri | 22:43:32 |
Lily Foster | Hmmm I think this might be a yarn2nix bug | 22:44:13 |
Lily Foster | I'm gonna try it using fetchYarnDeps and mkDerivation instead of mkYarnPackage and see what it does | 22:44:29 |
Lily Foster | Yeah this is 100% a yarn2nix bug. I just built marp-cli without it just fine | 22:53:42 |
Lily 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 Foster | Feel free to steal that entirely. I don't much want to invest more work in yarn2nix than I have to | 23:05:16 |
Lily Foster | That does basically the same thing buildYarnPackage will when it's done | 23:05:25 |
@gdesforges:matrix.org | Well 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 Foster | Rest wlel! | 23:09:18 |
Lily Foster | * Rest well! | 23:09:19 |
@gdesforges:matrix.org | Thank you so much for your dedication | 23:09:28 |
@gdesforges:matrix.org | Let me know if there is a way to pay you a tip/coffee:) | 23:09:43 |
Lily Foster | Yeah, happy to help. Apologies it took me this long to have the time/bandwidth to dig into it 😅 | 23:09:45 |
@gdesforges:matrix.org | * Let me know if there is a way to pay you a tip/coffee :) | 23:09:50 |
Lily 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 | I wouldn't ask if I felt pressured | 23:13:14 |
| @janik0:matrix.org joined the room. | 23:14:34 |
countoren | 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 | * 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 | * 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 Foster | I 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 Foster | If 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 | sure I could loom into it | 23:53:39 |
countoren | look | 23:53:43 |
countoren | what will be the correct way with buildNpmPackage to use ng? | 23:54:22 |
countoren | straight buildInputs? | 23:55:05 |
Lily Foster | nativeBuildInputs, but yeah probably. I never used angular/ng so I know nothing about it really | 23:57:25 |