Skip to content

Commit 877a10e

Browse files
authored
Merge pull request #43 from MatrixAI/feature-flake-indirect
Indirect package set flake input
2 parents dafa1c1 + 0f0a281 commit 877a10e

File tree

2 files changed

+55
-137
lines changed

2 files changed

+55
-137
lines changed

flake.lock

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

flake.nix

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,43 @@
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-private";
6+
};
67
flake-utils.url = "github:numtide/flake-utils";
78
};
89

9-
outputs = { nixpkgs, flake-utils, ... }:
10+
outputs = { nixpkgs-matrix, flake-utils, ... }:
1011
flake-utils.lib.eachDefaultSystem (system:
1112
let
12-
pkgs = import nixpkgs { inherit system; };
13+
pkgs = nixpkgs-matrix.legacyPackages.${system};
1314

14-
shell = { ci ? false }: with pkgs; mkShell {
15-
nativeBuildInputs = [
16-
nodejs_20
17-
shellcheck
18-
gitAndTools.gh
19-
];
20-
NIX_DONT_SET_RPATH = true;
21-
NIX_NO_SELF_RPATH = true;
22-
shellHook = ''
23-
echo "Entering $(npm pkg get name)"
24-
set -o allexport
25-
. ./.env
26-
set +o allexport
27-
set -v
28-
${
29-
lib.optionalString ci
30-
''
31-
set -o errexit
32-
set -o nounset
33-
set -o pipefail
34-
shopt -s inherit_errexit
35-
''
36-
}
37-
mkdir --parents "$(pwd)/tmp"
38-
export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH"
39-
npm install --ignore-scripts
40-
npx patch-package
41-
set +v
42-
'';
43-
};
44-
in
45-
{
15+
shell = { ci ? false }:
16+
with pkgs;
17+
mkShell {
18+
nativeBuildInputs = [ nodejs_20 shellcheck gitAndTools.gh ];
19+
NIX_DONT_SET_RPATH = true;
20+
NIX_NO_SELF_RPATH = true;
21+
shellHook = ''
22+
echo "Entering $(npm pkg get name)"
23+
set -o allexport
24+
. ./.env
25+
set +o allexport
26+
set -v
27+
${lib.optionalString ci ''
28+
set -o errexit
29+
set -o nounset
30+
set -o pipefail
31+
shopt -s inherit_errexit
32+
''}
33+
mkdir --parents "$(pwd)/tmp"
34+
export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH"
35+
npm install --ignore-scripts
36+
npx patch-package
37+
set +v
38+
'';
39+
};
40+
in {
4641
devShells = {
4742
default = shell { ci = false; };
4843
ci = shell { ci = true; };

0 commit comments

Comments
 (0)