Skip to content

Commit 152cb84

Browse files
authored
Merge pull request #125 from MatrixAI/feature-flake-indirect
Indirect package set flake input
2 parents 34c7299 + f127dba commit 152cb84

File tree

3 files changed

+114
-146
lines changed

3 files changed

+114
-146
lines changed

flake.lock

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

flake.nix

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,53 @@
11
{
22
inputs = {
3-
nixpkgs.url = "github:nixos/nixpkgs";
4-
nixpkgs.follows = "nixpkgs-matrix/nixpkgs";
5-
nixpkgs-matrix.url = "github:matrixai/nixpkgs-matrix";
3+
nixpkgs-matrix = {
4+
type = "indirect";
5+
id = "nixpkgs-matrix";
6+
inputs.nixpkgs.url =
7+
"github:NixOS/nixpkgs?rev=e69e710edfed397959507bcee120ec8a9c7ff03e";
8+
};
69
flake-utils.url = "github:numtide/flake-utils";
710
};
811

9-
outputs = { nixpkgs, flake-utils, ... }:
12+
outputs = { nixpkgs-matrix, flake-utils, ... }:
1013
flake-utils.lib.eachDefaultSystem (system:
1114
let
12-
pkgs = import nixpkgs { inherit system; };
15+
pkgs = nixpkgs-matrix.legacyPackages.${system};
1316

14-
shell = { ci ? false }: with pkgs; mkShell {
15-
nativeBuildInputs = [
16-
nodejs_20
17-
shellcheck
18-
gitAndTools.gh
19-
rustc
20-
cargo
21-
cmake
22-
rustPlatform.bindgenHook
23-
];
24-
NIX_DONT_SET_RPATH = true;
25-
NIX_NO_SELF_RPATH = true;
26-
RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
27-
shellHook = ''
28-
echo "Entering $(npm pkg get name)"
29-
set -o allexport
30-
. ./.env
31-
set +o allexport
32-
set -v
33-
${
34-
lib.optionalString ci
35-
''
36-
set -o errexit
37-
set -o nounset
38-
set -o pipefail
39-
shopt -s inherit_errexit
40-
''
41-
}
42-
mkdir --parents "$(pwd)/tmp"
43-
export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH"
44-
npm install --ignore-scripts
45-
set +v
46-
'';
47-
};
48-
in
49-
{
17+
shell = { ci ? false }:
18+
with pkgs;
19+
mkShell {
20+
nativeBuildInputs = [
21+
nodejs_20
22+
shellcheck
23+
gitAndTools.gh
24+
rustc
25+
cargo
26+
cmake
27+
rustPlatform.bindgenHook
28+
];
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+
${lib.optionalString ci ''
39+
set -o errexit
40+
set -o nounset
41+
set -o pipefail
42+
shopt -s inherit_errexit
43+
''}
44+
mkdir --parents "$(pwd)/tmp"
45+
export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH"
46+
npm install --ignore-scripts
47+
set +v
48+
'';
49+
};
50+
in {
5051
devShells = {
5152
default = shell { ci = false; };
5253
ci = shell { ci = true; };

package-lock.json

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

0 commit comments

Comments
 (0)