-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
61 lines (56 loc) · 1.54 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
{
description = "Shardus core";
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";
naersk.url = "github:nix-community/naersk";
};
outputs = {
self,
naersk,
nixpkgs,
shardus-cli,
utils,
}: let
appName = "shardus-core";
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; [
custom-nodejs
# rust dependencies for rust dependencies
cargo
];
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};
};
};
}