-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
107 lines (90 loc) · 2.27 KB
/
flake.nix
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
inputs = {
nixpkgs = {
type = "github";
owner = "nixos";
repo = "nixpkgs";
ref = "nixos-unstable";
};
crane = {
type = "github";
owner = "ipetkov";
repo = "crane";
};
fenix = {
type = "github";
owner = "nix-community";
repo = "fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-filter = {
type = "github";
owner = "numtide";
repo = "nix-filter";
};
flake-utils = {
type = "github";
owner = "numtide";
repo = "flake-utils";
};
identity-context = {
url = "https://w3c.credential.nexus/identity.jsonld";
flake = false;
};
};
outputs = {
nixpkgs,
crane,
fenix,
nix-filter,
flake-utils,
identity-context,
...
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {
inherit system;
};
src = nix-filter.lib.filter {
root = ./.;
include = [
"crates"
"Cargo.toml"
"Cargo.lock"
];
};
yarnLockHash = "sha256-s7dop16Msfcqp+hd/8GDxlQEM7VNfvAPrYBwPoSHJUE=";
testSrc = ./tests;
teddybearPkgs = pkgs.callPackage ./nix/scope.nix {
inherit crane fenix identity-context src testSrc yarnLockHash;
};
pkgConfigPath = pkgs.lib.makeSearchPathOutput "dev" "lib/pkgconfig" [
pkgs.openssl
];
in {
devShells = {
default = pkgs.mkShell {
buildInputs = [teddybearPkgs.rustToolchain pkgs.pkg-config pkgs.openssl pkgs.nodejs pkgs.yarn pkgs.twiggy];
inputsFrom = [teddybearPkgs.esm];
OPENSSL_NO_VENDOR = "1";
PKG_CONFIG_PATH = pkgConfigPath;
};
ci = pkgs.mkShell {
buildInputs = [teddybearPkgs.rustToolchain pkgs.cargo-edit];
};
};
packages = {
inherit (teddybearPkgs) cjs esm docs;
default = teddybearPkgs.uni;
};
apps.default = flake-utils.lib.mkApp {
drv = teddybearPkgs.repl;
};
checks = {
inherit (teddybearPkgs) cjs esm uni docs e2e-test unit-test clippy fmt;
};
formatter = pkgs.alejandra;
}
);
}