Add node-latest environment
This commit is contained in:
parent
cf33f63acc
commit
d92ca417a2
1
node-latest/.envrc
Normal file
1
node-latest/.envrc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
use flake
|
27
node-latest/flake.lock
Normal file
27
node-latest/flake.lock
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1689261696,
|
||||||
|
"narHash": "sha256-LzfUtFs9MQRvIoQ3MfgSuipBVMXslMPH/vZ+nM40LkA=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "df1eee2aa65052a18121ed4971081576b25d6b5c",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
27
node-latest/flake.nix
Normal file
27
node-latest/flake.nix
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
description = "A Nix-flake-based Node.js development environment";
|
||||||
|
|
||||||
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs }:
|
||||||
|
let
|
||||||
|
overlays = [
|
||||||
|
(final: prev: rec {
|
||||||
|
nodejs = prev.nodejs_20;
|
||||||
|
pnpm = prev.nodePackages.pnpm;
|
||||||
|
yarn = (prev.yarn.override { inherit nodejs; });
|
||||||
|
})
|
||||||
|
];
|
||||||
|
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
||||||
|
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
|
||||||
|
pkgs = import nixpkgs { inherit overlays system; };
|
||||||
|
});
|
||||||
|
in
|
||||||
|
{
|
||||||
|
devShells = forEachSupportedSystem ({ pkgs }: {
|
||||||
|
default = pkgs.mkShell {
|
||||||
|
packages = with pkgs; [ node2nix nodejs pnpm yarn ];
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
|
@ -7,7 +7,7 @@
|
||||||
let
|
let
|
||||||
overlays = [
|
overlays = [
|
||||||
(final: prev: rec {
|
(final: prev: rec {
|
||||||
nodejs = prev.nodejs-18_x;
|
nodejs = prev.nodejs;
|
||||||
pnpm = prev.nodePackages.pnpm;
|
pnpm = prev.nodePackages.pnpm;
|
||||||
yarn = (prev.yarn.override { inherit nodejs; });
|
yarn = (prev.yarn.override { inherit nodejs; });
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue