Skip to content

Commit

Permalink
build: run nix builds with a nightly compiler and add devshell
Browse files Browse the repository at this point in the history
  • Loading branch information
max-niederman committed Apr 25, 2024
1 parent b7d3c7d commit 1c85aca
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 8 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
/target

result
result-*

.direnv
77 changes: 73 additions & 4 deletions flake.lock

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

26 changes: 23 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,36 @@
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
crate2nix.url = "github:nix-community/crate2nix";
rust-overlay.url = "github:oxalica/rust-overlay";
};

outputs = { self, nixpkgs, flake-utils, crate2nix }:
nixConfig = {
extra-trusted-public-keys = "eigenvalue.cachix.org-1:ykerQDDa55PGxU25CETy9wF6uVDpadGGXYrFNJA3TUs=";
extra-substituters = "https://eigenvalue.cachix.org";
allow-import-from-derivation = true;
};

outputs = { self, nixpkgs, flake-utils, crate2nix, rust-overlay }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
cargoNix = crate2nix.tools.${system}.appliedCargoNix {
pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};

rust = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default);

cargoNixPath = crate2nix.tools.${system}.generatedCargoNix {
name = "centipede";
src = ./.;
};
cargoNix = import cargoNixPath {
inherit pkgs;
buildRustCrateForPkgs = pkgs: pkgs.buildRustCrate.override {
cargo = rust;
rustc = rust;
};
};
in
{
checks = {
Expand Down
3 changes: 2 additions & 1 deletion garnix.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
builds:
include:
- packages.*.*
- packages.*.*
- checks.*.*

0 comments on commit 1c85aca

Please sign in to comment.