forked from shardeum/shardeum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
58 lines (54 loc) · 1.46 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
{
description = "Shardeum server";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
shardus-cli.url = "git+https://gitlab.com/shardus/tools/shardus-cli?ref=nix-flake";
};
outputs = {
self,
nixpkgs,
shardus-cli,
utils,
}: let
appName = "shardeum-server";
out =
utils.lib.eachDefaultSystem
(system: let
pkgs = import nixpkgs {
inherit system;
};
buildNodeJs = pkgs.callPackage "${nixpkgs}/pkgs/development/web/nodejs/nodejs.nix" {python = pkgs.python3;};
custom-nodejs = buildNodeJs {
enableNpm = true;
version = "18.16.1";
sha256 = "0wp2xyz5yqcvb6949xaqpan73rfhdc3cdfsvx7vzvzc9in64yh78";
};
nativeBuildInputs = with pkgs; [
pkg-config
cargo
custom-nodejs
];
buildInputs = with pkgs; [];
in {
# `nix develop` or direnv
devShell = pkgs.mkShell {
packages =
nativeBuildInputs
++ buildInputs
++ (with pkgs; [
nodePackages.typescript-language-server
nodePackages.vscode-langservers-extracted
nodePackages.prettier
shardus-cli.packages.${system}.default
]);
};
});
in
out
// {
overlay = final: prev: {
${appName} = self.defaultPackage.${prev.system};
};
};
}