Skip to content

Commit b0db06e

Browse files
committed
chore: added flake.nix
1 parent cb62b01 commit b0db06e

File tree

2 files changed

+124
-0
lines changed

2 files changed

+124
-0
lines changed

flake.lock

Lines changed: 78 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
inputs = {
3+
nixpkgs-matrix = {
4+
type = "indirect";
5+
id = "nixpkgs-matrix";
6+
};
7+
flake-utils.url = "github:numtide/flake-utils";
8+
};
9+
10+
outputs = { nixpkgs-matrix, flake-utils, ... }:
11+
flake-utils.lib.eachDefaultSystem (system:
12+
let
13+
pkgs = nixpkgs-matrix.legacyPackages.${system};
14+
shell = { ci ? false }:
15+
with pkgs;
16+
pkgs.mkShell {
17+
nativeBuildInputs = [ nodejs_20 shellcheck gitAndTools.gh ];
18+
PKG_IGNORE_TAG = 1;
19+
shellHook = ''
20+
echo "Entering $(npm pkg get name)"
21+
set -o allexport
22+
. <(polykey secrets env js-virtualtar)
23+
set +o allexport
24+
set -v
25+
${lib.optionalString ci ''
26+
set -o errexit
27+
set -o nounset
28+
set -o pipefail
29+
shopt -s inherit_errexit
30+
''}
31+
mkdir --parents "$(pwd)/tmp"
32+
33+
export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH"
34+
35+
npm install --ignore-scripts
36+
37+
set +v
38+
'';
39+
};
40+
in {
41+
devShells = {
42+
default = shell { ci = false; };
43+
ci = shell { ci = true; };
44+
};
45+
});
46+
}

0 commit comments

Comments
 (0)