-
Notifications
You must be signed in to change notification settings - Fork 2k
chore: update nix flake #10485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shaunkh
wants to merge
9
commits into
foundry-rs:master
Choose a base branch
from
shaunkh:update-nix-flake
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
chore: update nix flake #10485
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ed3439e
update flake
shaunkh 3cc5f95
Merge branch 'master' into update-nix-flake
shaunkh 34682e9
Merge branch 'master' into update-nix-flake
shaunkh 033f8b7
update env variables
shaunkh 87b5c40
Merge branch 'master' into update-nix-flake
zerosnacks 6508d3f
add nix.yml ci job
zerosnacks 68645bd
review: use nixpkgs for solc
shaunkh 52d8049
Merge branch 'master' into update-nix-flake
shaunkh a5390e7
Merge branch 'master' into update-nix-flake
zerosnacks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: nix | ||
|
||
on: | ||
schedule: | ||
# Run weekly | ||
- cron: "0 0 * * SUN" | ||
workflow_dispatch: | ||
# Needed so we can run it manually | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
# Opens a PR with an updated flake.lock file | ||
update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: cachix/install-nix-action@v30 | ||
- uses: actions/checkout@v4 | ||
- uses: DeterminateSystems/update-flake-lock@main | ||
with: | ||
pr-title: "Update flake.lock" | ||
pr-labels: | | ||
L-ignore | ||
A-dependencies | ||
|
||
build: | ||
strategy: | ||
matrix: | ||
runs-on: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.runs-on }} | ||
steps: | ||
- uses: cachix/install-nix-action@v30 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Activate nix env | ||
run: nix develop -c echo Ok | ||
|
||
- name: Check that we can compile all crates | ||
run: nix develop -c cargo check --all-targets |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,45 @@ | ||
{ | ||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
rust-overlay = { | ||
url = "github:oxalica/rust-overlay"; | ||
inputs = { | ||
nixpkgs.follows = "nixpkgs"; | ||
}; | ||
}; | ||
solc = { | ||
url = "github:hellwolf/solc.nix"; | ||
inputs = { | ||
nixpkgs.follows = "nixpkgs"; | ||
flake-utils.follows = "flake-utils"; | ||
}; | ||
fenix = { | ||
url = "github:nix-community/fenix"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
}; | ||
|
||
outputs = { self, nixpkgs, rust-overlay, flake-utils, solc }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
overlays = [ rust-overlay.overlays.default solc.overlay ]; | ||
}; | ||
lib = pkgs.lib; | ||
toolchain = pkgs.rust-bin.stable.latest.default.override { | ||
extensions = [ "rustfmt" "clippy" "rust-src" ]; | ||
}; | ||
in | ||
{ | ||
devShells.default = pkgs.mkShell { | ||
nativeBuildInputs = with pkgs; [ | ||
pkg-config | ||
solc_0_8_23 | ||
(solc.mkDefault pkgs solc_0_8_23) | ||
toolchain | ||
]; | ||
buildInputs = lib.optionals pkgs.stdenv.isDarwin [ | ||
pkgs.darwin.apple_sdk.frameworks.AppKit | ||
]; | ||
packages = with pkgs; [ | ||
rust-analyzer-unwrapped | ||
]; | ||
outputs = { self, nixpkgs, fenix }: | ||
let eachSystem = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed; | ||
in { | ||
devShells = eachSystem (system: | ||
let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
overlays = [ fenix.overlays.default ]; | ||
}; | ||
|
||
lib = pkgs.lib; | ||
toolchain = fenix.packages.${system}.stable.toolchain; | ||
in { | ||
default = pkgs.mkShell { | ||
nativeBuildInputs = with pkgs; [ | ||
pkg-config | ||
toolchain | ||
|
||
# test dependencies | ||
solc | ||
vyper | ||
nodejs | ||
]; | ||
buildInputs = lib.optionals pkgs.stdenv.isDarwin | ||
[ pkgs.darwin.apple_sdk.frameworks.AppKit ]; | ||
|
||
# Environment variables | ||
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library"; | ||
LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.libusb1 ]; | ||
}; | ||
}); | ||
packages = with pkgs; [ rust-analyzer-unwrapped ]; | ||
|
||
# Environment variables | ||
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library"; | ||
LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.libusb1 ]; | ||
CFLAGS = "-DJEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ref for reviewers: https://github.com/foundry-rs/foundry/pull/9848/files, it is a fix for building |
||
}; | ||
}); | ||
}; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.