Skip to content

Instantly share code, notes, and snippets.

@danielres
Last active March 15, 2024 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielres/2a45362178636577965268d054278a68 to your computer and use it in GitHub Desktop.
Save danielres/2a45362178636577965268d054278a68 to your computer and use it in GitHub Desktop.
Nix flake with node_20 + pnpm
use_flake './flake.nix'
{
description = "Flake with nodejs_20 + pnpm";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
in {
devShell = pkgs.mkShell {
buildInputs = [
pkgs.nodejs_20
pkgs.nodejs_20.pkgs.pnpm
# pkgs.nodejs_20.pkgs.yarn
];
# Setup environment variables if necessary
shellHook = ''
export SOME_VAR="value"
'';
};
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment