-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
59 lines (53 loc) · 1.79 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
{
description = "Polygon Full Node";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = { self, nixpkgs, ... }:
let
# Supported architectures: x86_64 and aarch64
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
# Import Nixpkgs for all systems
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in
{
# Define the packages for all systems
packages = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
in {
bor = import ./pkgs/bor/default.nix {
lib = pkgs.lib;
stdenv = pkgs.stdenv;
buildGoModule = pkgs.buildGoModule;
fetchFromGitHub = pkgs.fetchFromGitHub;
libobjc = pkgs.darwin.libobjc;
IOKit = pkgs.darwin.IOKit;
};
heimdall-polygon = import ./pkgs/heimdall-polygon/default.nix {
lib = pkgs.lib;
stdenv = pkgs.stdenv;
buildGoModule = pkgs.buildGoModule;
fetchFromGitHub = pkgs.fetchFromGitHub;
libobjc = pkgs.darwin.libobjc;
IOKit = pkgs.darwin.IOKit;
};
}
);
# Define devShell for development environments
devShell = forAllSystems (system:
nixpkgsFor.${system}.mkShell {
nativeBuildInputs = [
self.packages.${system}.bor
self.packages.${system}.heimdall-polygon
nixpkgsFor.${system}.go
nixpkgsFor.${system}.git
];
}
);
# NixOS modules output
nixosModules.bor = import ./modules/bor/default.nix;
nixosModules.heimdall-polygon = import ./modules/heimdall-polygon/default.nix;
};
}