Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
80 lines (79 loc) · 2.21 KB
/
Copy pathflake.nix
File metadata and controls
80 lines (79 loc) · 2.21 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
{
inputs = {
nixpkgs-matrixai = {
type = "indirect";
id = "nixpkgs-matrixai";
};
nixpkgs.follows = "nixpkgs-matrixai/nixpkgs";
flake-parts.follows = "nixpkgs-matrixai/flake-parts";
devenv = {
url = "github:cachix/devenv";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{
devenv,
flake-parts,
nixpkgs-matrixai,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ devenv.flakeModule ];
systems = [ "x86_64-linux" ];
perSystem =
{ system, ... }:
let
pkgs = nixpkgs-matrixai.legacyPackages.${system};
nodejs = pkgs.nodejs_24;
lint = pkgs.matrixai-lint.withTools [
pkgs.nixfmt
pkgs.shellcheck
];
npmLibrary = nixpkgs-matrixai.lib.npmBridge.producer.libraryFromRoot {
inherit pkgs nodejs;
gitignore = nixpkgs-matrixai.lib.gitignore;
root = ./.;
self = inputs.self;
buildExcludeDevDependencies = [ "@matrixai/async-init" ];
};
in
{
packages = {
default = npmLibrary.npmPackage.out;
npm-build = npmLibrary.npmBuild;
npm-package = npmLibrary.npmPackage.out;
npm-package-unpacked = npmLibrary.npmPackage.unpacked;
};
formatter = lint.formatter;
checks = import ./nix/checks {
inherit
pkgs
nodejs
lint
system
npmLibrary
;
};
devenv.shells.default = { lib, ... }: {
containers = lib.mkForce { };
devenv.root = lib.mkForce (
let
root = builtins.getEnv "PWD";
in
if root == "" then toString ./. else root
);
packages = [
nodejs
(pkgs.lib.hiPrio npmLibrary.npm)
lint
pkgs.gh
];
enterShell = ''
mkdir -p "$PWD/tmp"
export PATH="${npmLibrary.npm}/bin:${lint}/bin:$PWD/dist/bin:$PWD/node_modules/.bin:$PATH"
'';
};
};
};
}