|
1 | 1 | { |
2 | 2 | inputs = { |
3 | | - nixpkgs.url = "github:nixos/nixpkgs"; |
| 3 | + nixpkgs-matrix = { |
| 4 | + type = "indirect"; |
| 5 | + id = "nixpkgs-matrix"; |
| 6 | + }; |
4 | 7 | flake-utils.url = "github:numtide/flake-utils"; |
5 | | - |
6 | | - nixpkgs.follows = "nixpkgs-matrix/nixpkgs"; |
7 | | - nixpkgs-matrix.url = "github:matrixai/nixpkgs-matrix"; |
8 | 8 | }; |
9 | 9 |
|
10 | | - outputs = { nixpkgs, flake-utils, ... }: |
| 10 | + outputs = { nixpkgs-matrix, flake-utils, ... }: |
11 | 11 | flake-utils.lib.eachDefaultSystem (system: |
12 | 12 | let |
13 | | - pkgs = import nixpkgs { |
14 | | - inherit system; |
15 | | - }; |
| 13 | + pkgs = nixpkgs-matrix.legacyPackages.${system}; |
16 | 14 |
|
17 | | - shell = { ci ? false }: with pkgs; mkShell { |
18 | | - nativeBuildInputs = [ |
19 | | - nodejs |
20 | | - shellcheck |
21 | | - patchelf |
22 | | - gitAndTools.gh |
23 | | - ]; |
24 | | - shellHook = '' |
25 | | - echo "Entering $(npm pkg get name)" |
26 | | - set -o allexport |
27 | | - . ./.env |
28 | | - set +o allexport |
29 | | - set -v |
30 | | - ${ |
31 | | - lib.optionalString ci |
32 | | - '' |
33 | | - set -o errexit |
34 | | - set -o nounset |
35 | | - set -o pipefail |
36 | | - shopt -s inherit_errexit |
37 | | - '' |
38 | | - } |
39 | | - mkdir --parents "$(pwd)/tmp" |
40 | | - export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH" |
41 | | - npm install --ignore-scripts |
42 | | - if [ -f 'node_modules/@cloudflare/workerd-linux-64/bin/workerd' ]; then |
43 | | - patchelf \ |
44 | | - --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ |
45 | | - node_modules/@cloudflare/workerd-linux-64/bin/workerd |
46 | | - fi |
47 | | - set +v |
48 | | - ''; |
49 | | - }; |
50 | | - in |
51 | | - { |
| 15 | + shell = { ci ? false }: |
| 16 | + with pkgs; |
| 17 | + mkShell { |
| 18 | + nativeBuildInputs = [ nodejs shellcheck patchelf gitAndTools.gh ]; |
| 19 | + shellHook = '' |
| 20 | + echo "Entering $(npm pkg get name)" |
| 21 | + set -o allexport |
| 22 | + . ./.env |
| 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 | + export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH" |
| 33 | + npm install --ignore-scripts |
| 34 | + if [ -f 'node_modules/@cloudflare/workerd-linux-64/bin/workerd' ]; then |
| 35 | + patchelf \ |
| 36 | + --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ |
| 37 | + node_modules/@cloudflare/workerd-linux-64/bin/workerd |
| 38 | + fi |
| 39 | + set +v |
| 40 | + ''; |
| 41 | + }; |
| 42 | + in { |
52 | 43 | devShells = { |
53 | 44 | default = shell { ci = false; }; |
54 | 45 | ci = shell { ci = true; }; |
|
0 commit comments