Skip to content

Commit 1ffb66f

Browse files
tegefaulkesbrynblack
authored andcommitted
feat: switch to indirect inputs
1 parent 8f099a8 commit 1ffb66f

File tree

2 files changed

+52
-155
lines changed

2 files changed

+52
-155
lines changed

flake.lock

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

flake.nix

+38-47
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,56 @@
11
{
22
inputs = {
3-
nixpkgs.url = "github:nixos/nixpkgs";
43
flake-utils.url = "github:numtide/flake-utils";
5-
6-
nixpkgs-matrix.url = "github:matrixai/nixpkgs-matrix";
7-
nixpkgs.follows = "nixpkgs-matrix/nixpkgs";
4+
nixpkgs-matrix = {
5+
type = "indirect";
6+
id = "nixpkgs-matrix";
7+
};
88
};
99

10-
outputs = { nixpkgs, flake-utils, ... }:
10+
outputs = { nixpkgs-matrix, flake-utils, ... }:
1111
flake-utils.lib.eachSystem ([
1212
"x86_64-linux"
1313
"x86_64-windows"
1414
"x86_64-darwin"
1515
"aarch64-darwin"
1616
]) (system:
1717
let
18-
pkgs = import nixpkgs {
19-
system = system;
20-
};
18+
pkgs = nixpkgs-matrix.legacyPackages.${system};
2119

22-
shell = { ci ? false }: with pkgs; pkgs.mkShell {
23-
nativeBuildInputs = [
24-
nodejs_20
25-
shellcheck
26-
jq
27-
];
28-
# Don't set rpath for native addons
29-
NIX_DONT_SET_RPATH = true;
30-
NIX_NO_SELF_RPATH = true;
31-
RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
32-
shellHook = ''
33-
echo "Entering $(npm pkg get name)"
34-
set -o allexport
35-
. ./.env
36-
set +o allexport
37-
set -v
38-
${
39-
lib.optionalString ci
40-
''
41-
set -o errexit
42-
set -o nounset
43-
set -o pipefail
44-
shopt -s inherit_errexit
45-
''
46-
}
47-
mkdir --parents "$(pwd)/tmp"
20+
shell = { ci ? false }:
21+
with pkgs;
22+
pkgs.mkShell {
23+
nativeBuildInputs = [ nodejs_20 shellcheck jq ];
24+
# Don't set rpath for native addons
25+
NIX_DONT_SET_RPATH = true;
26+
NIX_NO_SELF_RPATH = true;
27+
RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
28+
shellHook = ''
29+
echo "Entering $(npm pkg get name)"
30+
set -o allexport
31+
. ./.env
32+
set +o allexport
33+
set -v
34+
${lib.optionalString ci ''
35+
set -o errexit
36+
set -o nounset
37+
set -o pipefail
38+
shopt -s inherit_errexit
39+
''}
40+
mkdir --parents "$(pwd)/tmp"
4841
49-
# Built executables and NPM executables
50-
export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH"
42+
# Built executables and NPM executables
43+
export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH"
5144
52-
npm install --ignore-scripts
45+
npm install --ignore-scripts
5346
54-
set +v
55-
'';
56-
};
57-
in
58-
{
59-
devShells = {
60-
default = shell { ci = false; };
61-
ci = shell { ci = true; };
47+
set +v
48+
'';
6249
};
63-
}
64-
);
50+
in {
51+
devShells = {
52+
default = shell { ci = false; };
53+
ci = shell { ci = true; };
54+
};
55+
});
6556
}

0 commit comments

Comments
 (0)