-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
86 lines (78 loc) · 2.23 KB
/
flake.nix
File metadata and controls
86 lines (78 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{
inputs = {
nixpkgs-matrixai.url = "github:MatrixAI/nixpkgs-matrixai";
flake-parts.follows = "nixpkgs-matrixai/flake-parts";
nixpkgs.follows = "nixpkgs-matrixai/nixpkgs";
};
outputs =
inputs@{
flake-parts,
nixpkgs-matrixai,
...
}:
let
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
shellFor =
pkgs:
{
ci ? false,
}:
with pkgs;
mkShell {
nativeBuildInputs = [
nodejs_20
shellcheck
gh
];
shellHook = ''
echo "Entering $(npm pkg get name)"
set -v
${lib.optionalString ci ''
set -o errexit
set -o nounset
set -o pipefail
shopt -s inherit_errexit
''}
mkdir --parents "$PWD/tmp"
# Built executables and NPM executables
export PATH="$PWD/dist/bin:$PWD/node_modules/.bin:$PATH"
flock -x tmp/npm-install.lock \
npm install --ignore-scripts --no-audit --fund=false --prefer-offline
set +v
'';
};
in
flake-parts.lib.mkFlake { inherit inputs; } {
# Declared systems are support claims. Keep this set conservative and
# expand only when evaluation/build evidence exists.
systems = systems;
perSystem =
{ system, ... }:
let
pkgs = nixpkgs-matrixai.legacyPackages.${system};
defaultShell = shellFor pkgs { ci = false; };
ciShell = shellFor pkgs { ci = true; };
in
{
devShells = {
default = defaultShell;
ci = ciShell;
};
checks = {
unit-dev-shell-default = defaultShell;
unit-dev-shell-ci = ciShell;
};
};
# If this repo vendors matrixai-standards at
# `./.matrixai/matrixai-standards/`, materialize runtime skills with:
# nix run './.matrixai/matrixai-standards#skills-materializer' -- \
# --standards-root ./.matrixai/matrixai-standards \
# --root-skill js-npm-matrixai-logger \
# --output ./.agents/skills
};
}