-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
52 lines (46 loc) · 1.58 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
{
description = "Polygon Heimdall Validator Node";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-compat.url = "github:nix-community/flake-compat";
};
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 Heimdall package for all systems
packages = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
in {
heimdall-polygon = import ./pkgs/heimdall/default.nix {
lib = pkgs.lib;
stdenv = pkgs.stdenv;
buildGoModule = pkgs.buildGoModule;
fetchFromGitHub = pkgs.fetchFromGitHub;
libobjc = pkgs.darwin.libobjc;
IOKit = pkgs.darwin.IOKit;
};
}
);
# Make Heimdall the default package
defaultPackage = forAllSystems (system: self.packages.${system}.heimdall-polygon);
# Define devShell for development
devShell = forAllSystems (system:
nixpkgsFor.${system}.mkShell {
nativeBuildInputs = [
self.packages.${system}.heimdall-polygon
nixpkgsFor.${system}.go
nixpkgsFor.${system}.git
];
}
);
# NixOS module output for Heimdall
nixosModules.default = import ./modules/heimdall/default.nix;
};
}