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

Refactor nix #15

Merged
merged 2 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading