forked from pyth-network/pyth-crosschain
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshell.nix
69 lines (62 loc) · 1.52 KB
/
shell.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
{
sources ? import ./sources.nix,
nixpkgs ? sources.nixpkgs,
niv ? sources.niv,
mkCli ? sources.mkCli,
}: let
niv-overlay = self: _: {
niv = self.symlinkJoin {
name = "niv";
paths = [niv];
buildInputs = [self.makeWrapper];
postBuild = ''
wrapProgram $out/bin/niv \
--add-flags "--sources-file ${toString ./sources.json}"
'';
};
};
mkCli-overlay = import "${mkCli}/overlay.nix";
nodejs-overlay = _: super: {
nodejs = super.nodejs_18;
};
pkgs = import nixpkgs {
overlays = [
niv-overlay
mkCli-overlay
nodejs-overlay
];
config = {};
};
cli = pkgs.lib.mkCli "cli" {
_noAll = true;
install = "${pkgs.nodePackages.pnpm}/bin/pnpm i";
test = {
nix = {
lint = "${pkgs.statix}/bin/statix check --ignore node_modules .";
dead-code = "${pkgs.deadnix}/bin/deadnix --exclude ./node_modules .";
format = "${pkgs.alejandra}/bin/alejandra --exclude ./node_modules --check .";
};
};
fix = {
nix = {
lint = "${pkgs.statix}/bin/statix fix --ignore node_modules .";
dead-code = "${pkgs.deadnix}/bin/deadnix --exclude ./node_modules -e .";
format = "${pkgs.alejandra}/bin/alejandra --exclude ./node_modules .";
};
};
};
in
pkgs.mkShell {
FORCE_COLOR = 1;
buildInputs = [
cli
pkgs.git
pkgs.niv
pkgs.nodejs
pkgs.python3
pkgs.pkg-config
pkgs.nodePackages.pnpm
pkgs.cargo
pkgs.pre-commit
];
}