Hi,
I’m trying to create a flake that output a node package binary, i’m a little lost with nix-npm-buildpackage
as overlay.
The node file to git clone (with recursion because there is module) and package is here : GitHub - graphlab-fr/cosma-cli: Cosma is a document graph visualization tool. It modelizes interlinked Markdown files and renders them as an interactive network in a web interface. This is the command-line version of Cosma.
I use nix-npm-buildpackage to try to do this job : GitHub - serokell/nix-npm-buildpackage: Build nix packages that use npm/yarn
I will use the output of this binary flakes as input for another flakes.
My actual try is bottom, i don’t understand how i could pass the result of cosmabinary
variable to defaultPackage
{
description = "packaging cosma cli";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs";
nix-npm-buildpackage.url = "github:serokell/nix-npm-buildpackage";
};
outputs = { self, nixpkgs, flake-utils, nix-npm-buildpackage }:
flake-utils.lib.eachsystem [ "x86_64-linux" ] (system:
let
overlays = [nix-npm-buildpackage.overlay
(final: prev: {
cosmabinary = prev.buildnpmpackage {
src = final.fetchfromgithub
{
name = "cosma";
owner = "cosmateam";
repo = "graphlab-fr/cosma-cli";
rev = "5fdf7f99fec50218070a2f871eb9da9160ef0f2c";
sha256 = "";
};
postinstall = ''
npm pack
cp graphlab-fr-cosma-1.1.0.tgz $out
'';
};
})
];
pkgsfor = import nixpkgs { inherit system overlays; };
flake = pkgsfor.cosmabinary;
in flake // {
inherit overlays;
defaultpackage = flake.packages;
});
}