Skip to content

Commit

Permalink
chore: Update nixpkgs pin
Browse files Browse the repository at this point in the history
Part of #54

Commit 3e889463e499537c602e3ea83da6e33f9dc974da

+ create pnpm derivation directly from version 9.15.1
  • Loading branch information
Gashmob committed Dec 27, 2024
1 parent 4caf7dc commit 00a9f74
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
8 changes: 6 additions & 2 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/archive/eb28b94bd14835836b539bc3854a6abf929876d4.tar.gz";
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/archive/3e889463e499537c602e3ea83da6e33f9dc974da.tar.gz";
pkgs = import nixpkgs { config = {}; overlays = []; };
in

let
pnpm = pkgs.callPackage ./tools/nix/pnpm.nix { nodejs = pkgs.nodejs_20; };
in

pkgs.mkShell {
name = "filc-dev-env";

Expand All @@ -17,7 +21,7 @@ pkgs.mkShell {
pkgs.rpm
pkgs.jre_minimal
pkgs.nodejs_20
pkgs.corepack_20
pnpm
pkgs.llvmPackages_18.libllvm
pkgs.libffi
pkgs.libxml2
Expand Down
33 changes: 33 additions & 0 deletions tools/nix/pnpm.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{ stdenvNoCC
, fetchurl
, nodejs
}:

# From https://github.com/NixOS/nixpkgs/blob/nixos-24.11/pkgs/development/tools/pnpm/generic.nix
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "pnpm";
version = "9.15.1";

src = fetchurl {
url = "https://registry.npmjs.org/pnpm/-/pnpm-${finalAttrs.version}.tgz";
hash = "sha256-nlNOcK/vBjdPYSa0S9pXYJRxNc4WowrvEBDpZft+Pj4=";
};
# Remove binary files from src, we don't need them, and this way we make sure
# our distribution is free of binaryNativeCode
preConfigure = ''
rm -r dist/reflink.*node dist/vendor
'';

buildInputs = [ nodejs ];

installPhase = ''
runHook preInstall
install -d $out/{bin,libexec}
cp -R . $out/libexec/pnpm
ln -s $out/libexec/pnpm/bin/pnpm.cjs $out/bin/pnpm
ln -s $out/libexec/pnpm/bin/pnpx.cjs $out/bin/pnpx
runHook postInstall
'';
})

0 comments on commit 00a9f74

Please sign in to comment.