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

Commit

Permalink
Merge pull request #15 from cspr-rad/refactor-nix
Browse files Browse the repository at this point in the history
Refactor nix
  • Loading branch information
marijanp authored Apr 25, 2024
2 parents e03fcf2 + 951084c commit b839755
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
14 changes: 10 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,27 @@
in
{
herculesCI.ciSystems = [ "x86_64-linux" ];
overlays.default = import ./overlay.nix;
templates.default = {
path = ./templates/default;
description = "risc0 project template";
};
}
// eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system}.extend (import rust-overlay);
risc0pkgs = pkgs.recurseIntoAttrs (pkgs.callPackage ./pkgs { });
pkgs = import nixpkgs {
inherit system;
overlays = [
(import rust-overlay)
self.overlays.default
];
};
lib = pkgs.recurseIntoAttrs (pkgs.callPackage ./lib { pkgs = pkgs; });
in
{
inherit lib;
inherit (pkgs) lib;
packages = {
inherit (risc0pkgs) r0vm;
inherit (pkgs) r0vm;
};

formatter = pkgs.nixpkgs-fmt;
Expand Down
6 changes: 6 additions & 0 deletions overlay.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
final: prev: {
r0vm = final.callPackage ./pkgs/r0vm { };
lib = (prev.lib or { }) // {
buildRisc0Package = final.callPackage ./lib/buildRisc0Package.nix { };
};
}
5 changes: 0 additions & 5 deletions pkgs/default.nix

This file was deleted.

2 changes: 1 addition & 1 deletion templates/default/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
inputs = {
nixpkgs.follows = "risc0pkgs/nixpkgs";
# Always use the commit hash that is being updated
risc0pkgs.url = "github:cspr-rad/risc0pkgs/9b72640223c1c7d305581c70900a22294d7a5667";
risc0pkgs.url = "github:cspr-rad/risc0pkgs";
};

outputs = { self, nixpkgs, risc0pkgs }:
Expand Down

0 comments on commit b839755

Please sign in to comment.