Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
template: add x86_64-darwin, aarch64-darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
marijanp committed Jan 12, 2024
1 parent 452d354 commit 1f57694
Showing 1 changed file with 32 additions and 20 deletions.
52 changes: 32 additions & 20 deletions templates/default/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,40 @@
};
outputs = { self, nixpkgs, risc0pkgs }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSystem = nixpkgs.lib.genAttrs systems;
in
{
packages.${system}.risc0package =
risc0pkgs.lib.${system}.buildRisc0Package {
pname = "risc0package";
version = "0.0.1";
src = ./.;
doCheck = false;
cargoSha256 = "sha256-oY52S/Yljkn9lfH8oA8+XkCwAwOaOBzIT5uLCMZZYxI=";
nativeBuildInputs = [ pkgs.makeWrapper ];
postInstall = ''
wrapProgram $out/bin/host \
--set PATH ${pkgs.lib.makeBinPath [ risc0pkgs.packages.${system}.r0vm ]}
'';
};
packages = forEachSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
risc0package =
risc0pkgs.lib.${system}.buildRisc0Package {
pname = "risc0package";
version = "0.0.1";
src = ./.;
doCheck = false;
cargoSha256 = "sha256-oY52S/Yljkn9lfH8oA8+XkCwAwOaOBzIT5uLCMZZYxI=";
nativeBuildInputs = [ pkgs.makeWrapper ];
postInstall = ''
wrapProgram $out/bin/host \
--set PATH ${pkgs.lib.makeBinPath [ risc0pkgs.packages.${system}.r0vm ]}
'';
};
});

devShells.${system}.default = pkgs.mkShell {
RISC0_DEV_MODE = 1;
inputsFrom = [ self.packages.${system}.risc0package ];
nativeBuildInputs = [ risc0pkgs.packages.${system}.r0vm ];
};
devShells = forEachSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = pkgs.mkShell {
RISC0_DEV_MODE = 1;
inputsFrom = [ self.packages.${system}.risc0package ];
nativeBuildInputs = [ risc0pkgs.packages.${system}.r0vm ];
};
});
};
}

0 comments on commit 1f57694

Please sign in to comment.