|
1 | 1 | {
|
2 | 2 | inputs = {
|
3 | 3 | nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
4 |
| - rust.url = "github:oxalica/rust-overlay"; |
5 | 4 | foundry.url = "github:shazow/foundry.nix/5af12b6f2b708858ef3120041546ed6b038474a5";
|
| 5 | + fenix = { |
| 6 | + url = "github:nix-community/fenix"; |
| 7 | + inputs.nixpkgs.follows = "nixpkgs"; |
| 8 | + }; |
6 | 9 | process-compose-flake.url = "github:Platonic-Systems/process-compose-flake";
|
7 | 10 | services-flake.url = "github:juspay/services-flake";
|
8 | 11 | flake-parts.url = "github:hercules-ci/flake-parts";
|
9 | 12 | };
|
10 | 13 |
|
11 |
| - outputs = inputs@{ flake-parts, process-compose-flake, services-flake, nixpkgs, rust, foundry, ... }: |
| 14 | + outputs = inputs@{ flake-parts, process-compose-flake, services-flake, nixpkgs, fenix, foundry, ... }: |
12 | 15 | flake-parts.lib.mkFlake { inherit inputs; } {
|
13 | 16 | imports = [ process-compose-flake.flakeModule ];
|
14 | 17 | systems = [
|
|
21 | 24 | perSystem = { config, self', inputs', pkgs, system, ... }:
|
22 | 25 | let
|
23 | 26 | overlays = [
|
24 |
| - (import rust) |
25 |
| - (self: super: { |
26 |
| - rust-toolchain = super.rust-bin.stable.latest.default; |
27 |
| - }) |
| 27 | + fenix.overlays.default |
28 | 28 | foundry.overlay
|
29 | 29 | ];
|
30 | 30 |
|
31 |
| - pkgsWithOverlays = import nixpkgs { |
| 31 | + pkgs = import nixpkgs { |
32 | 32 | inherit overlays system;
|
33 | 33 | };
|
| 34 | + |
| 35 | + toolchain = with fenix.packages.${system}; combine [ |
| 36 | + (fromToolchainFile { |
| 37 | + file = ./rust-toolchain.toml; |
| 38 | + sha256 = "sha256-+9FmLhAOezBZCOziO0Qct1NOrfpjNsXxc/8I0c7BdKE="; |
| 39 | + }) |
| 40 | + stable.rust-src # This is needed for rust-analyzer to find stdlib symbols. Should use the same channel as the toolchain. |
| 41 | + ]; |
34 | 42 | in {
|
35 |
| - devShells.default = pkgsWithOverlays.mkShell { |
36 |
| - packages = (with pkgsWithOverlays; [ |
37 |
| - rust-toolchain |
| 43 | + devShells.default = pkgs.mkShell { |
| 44 | + packages = (with pkgs; [ |
| 45 | + toolchain |
38 | 46 | foundry-bin
|
39 | 47 | solc
|
40 | 48 | protobuf
|
|
63 | 71 | initialDatabases = [
|
64 | 72 | {
|
65 | 73 | inherit name;
|
66 |
| - schemas = [ (pkgsWithOverlays.writeText "init-${name}.sql" '' |
| 74 | + schemas = [ (pkgs.writeText "init-${name}.sql" '' |
67 | 75 | CREATE EXTENSION IF NOT EXISTS pg_trgm;
|
68 | 76 | CREATE EXTENSION IF NOT EXISTS btree_gist;
|
69 | 77 | CREATE EXTENSION IF NOT EXISTS postgres_fdw;
|
|
146 | 154 |
|
147 | 155 | services.anvil."anvil-integration" = {
|
148 | 156 | enable = true;
|
149 |
| - package = pkgsWithOverlays.foundry-bin; |
| 157 | + package = pkgs.foundry-bin; |
150 | 158 | port = 3021;
|
151 | 159 | timestamp = 1743944919;
|
152 | 160 | gasLimit = 100000000000;
|
|
0 commit comments