Skip to content
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
60 changes: 32 additions & 28 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 20 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
rust.url = "github:oxalica/rust-overlay";
foundry.url = "github:shazow/foundry.nix/5af12b6f2b708858ef3120041546ed6b038474a5";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
process-compose-flake.url = "github:Platonic-Systems/process-compose-flake";
services-flake.url = "github:juspay/services-flake";
flake-parts.url = "github:hercules-ci/flake-parts";
};

outputs = inputs@{ flake-parts, process-compose-flake, services-flake, nixpkgs, rust, foundry, ... }:
outputs = inputs@{ flake-parts, process-compose-flake, services-flake, nixpkgs, fenix, foundry, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ process-compose-flake.flakeModule ];
systems = [
Expand All @@ -21,20 +24,25 @@
perSystem = { config, self', inputs', pkgs, system, ... }:
let
overlays = [
(import rust)
(self: super: {
rust-toolchain = super.rust-bin.stable.latest.default;
})
fenix.overlays.default
foundry.overlay
];

pkgsWithOverlays = import nixpkgs {
pkgs = import nixpkgs {
inherit overlays system;
};

toolchain = with fenix.packages.${system}; combine [
(fromToolchainFile {
file = ./rust-toolchain.toml;
sha256 = "sha256-+9FmLhAOezBZCOziO0Qct1NOrfpjNsXxc/8I0c7BdKE=";
})
stable.rust-src # This is needed for rust-analyzer to find stdlib symbols. Should use the same channel as the toolchain.
];
in {
devShells.default = pkgsWithOverlays.mkShell {
packages = (with pkgsWithOverlays; [
rust-toolchain
devShells.default = pkgs.mkShell {
packages = (with pkgs; [
toolchain
foundry-bin
solc
protobuf
Expand Down Expand Up @@ -63,7 +71,7 @@
initialDatabases = [
{
inherit name;
schemas = [ (pkgsWithOverlays.writeText "init-${name}.sql" ''
schemas = [ (pkgs.writeText "init-${name}.sql" ''
CREATE EXTENSION IF NOT EXISTS pg_trgm;
CREATE EXTENSION IF NOT EXISTS btree_gist;
CREATE EXTENSION IF NOT EXISTS postgres_fdw;
Expand Down Expand Up @@ -146,7 +154,7 @@

services.anvil."anvil-integration" = {
enable = true;
package = pkgsWithOverlays.foundry-bin;
package = pkgs.foundry-bin;
port = 3021;
timestamp = 1743944919;
gasLimit = 100000000000;
Expand Down