-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
38 lines (31 loc) · 1.15 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
{
description = "snarkjs-cardano";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }: let
# Function to import the default.nix for a given system
makePackage = system: import ./default.nix {
inherit (nixpkgs.legacyPackages.${system}) pkgs;
nodejs = nixpkgs.legacyPackages.${system}.nodejs; # adjust nodejs attribute for the system
};
# Define a function to build the package for each supported system
buildPackages = system: let
nodePackages = makePackage system;
in nodePackages."snarkjs";
# List of supported systems
supportedSystems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
# Apply buildPackages to each system
packagesForSystems = builtins.listToAttrs (map (system:
{ name = system; value = buildPackages system; }) supportedSystems);
in {
packages = packagesForSystems;
defaultPackage.x86_64-linux = packagesForSystems."x86_64-linux";
defaultPackage.x86_64-darwin = packagesForSystems."x86_64-darwin";
defaultPackage.aarch64-darwin = packagesForSystems."aarch64-darwin";
};
}