Skip to content

Commit 9b408d9

Browse files
committed
Add flake for managing nodeJS version
1 parent 95b98ed commit 9b408d9

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed

.envrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@
99
/.psa*
1010
/.vscode/
1111
/.spago/
12+
.direnv
13+
*.swp

flake.lock

+43
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
description = "Provide an environment for working in this repo";
3+
4+
# to handle mac and linux
5+
inputs.flake-utils.url = "github:numtide/flake-utils";
6+
7+
# we want to use a consistent nixpkgs across developers.
8+
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
9+
10+
outputs = all@{ self, nixpkgs, flake-utils, ... }:
11+
flake-utils.lib.eachDefaultSystem (system:
12+
let
13+
pkgs = import nixpkgs {
14+
inherit system;
15+
};
16+
packages =
17+
let
18+
# everything we want available in our development environment that isn't managed by
19+
# npm, spago
20+
# we do not differentiate between libraries needed for building and tools at the moment.
21+
sharedPackages = with pkgs; [
22+
nodejs-16_x
23+
];
24+
in
25+
sharedPackages;
26+
in {
27+
# produce our actual shell
28+
devShell = pkgs.mkShell rec {
29+
# make our packages available
30+
buildInputs = packages;
31+
};
32+
}
33+
);
34+
}

0 commit comments

Comments
 (0)