|
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 = fenix.packages.${system}.fromToolchainFile { |
| 36 | + file = ./rust-toolchain.toml; |
| 37 | + sha256 = "sha256-+9FmLhAOezBZCOziO0Qct1NOrfpjNsXxc/8I0c7BdKE="; |
| 38 | + }; |
34 | 39 | in { |
35 | | - devShells.default = pkgsWithOverlays.mkShell { |
36 | | - packages = (with pkgsWithOverlays; [ |
37 | | - rust-toolchain |
| 40 | + devShells.default = pkgs.mkShell { |
| 41 | + packages = (with pkgs; [ |
| 42 | + toolchain |
38 | 43 | foundry-bin |
39 | 44 | solc |
40 | 45 | protobuf |
|
44 | 49 | nodejs |
45 | 50 | postgresql |
46 | 51 | ]); |
| 52 | + |
| 53 | + shellHook = '' |
| 54 | + export RUST_SRC_PATH="${toolchain}/lib/rustlib/src/rust/library" |
| 55 | + ''; |
47 | 56 | }; |
48 | 57 |
|
49 | 58 | process-compose = let |
|
63 | 72 | initialDatabases = [ |
64 | 73 | { |
65 | 74 | inherit name; |
66 | | - schemas = [ (pkgsWithOverlays.writeText "init-${name}.sql" '' |
| 75 | + schemas = [ (pkgs.writeText "init-${name}.sql" '' |
67 | 76 | CREATE EXTENSION IF NOT EXISTS pg_trgm; |
68 | 77 | CREATE EXTENSION IF NOT EXISTS btree_gist; |
69 | 78 | CREATE EXTENSION IF NOT EXISTS postgres_fdw; |
|
146 | 155 |
|
147 | 156 | services.anvil."anvil-integration" = { |
148 | 157 | enable = true; |
149 | | - package = pkgsWithOverlays.foundry-bin; |
| 158 | + package = pkgs.foundry-bin; |
150 | 159 | port = 3021; |
151 | 160 | timestamp = 1743944919; |
152 | 161 | gasLimit = 100000000000; |
|
0 commit comments