nix: use rust-overlay for nightly Rust

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I74b2d21496261a3178ce043a5990583d6a6a6964
This commit is contained in:
raf 2026-02-07 23:01:42 +03:00
commit c310ca5635
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
9 changed files with 65 additions and 12 deletions

23
flake.lock generated
View file

@ -34,7 +34,28 @@
"root": {
"inputs": {
"crane": "crane",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1770433312,
"narHash": "sha256-IaiqGwmLBrR0z67t/oaS6GIFxv9V8mDY7dBTuYVTbKY=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "9922ff9f99a6436756cbe6f5d11f9c3630e58cf0",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
}
},

View file

@ -2,12 +2,17 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixpkgs-unstable";
crane.url = "github:ipetkov/crane";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
nixpkgs,
crane,
self,
rust-overlay,
...
}: let
inherit (nixpkgs) lib;
@ -20,8 +25,16 @@
};
packages = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
craneLib = crane.mkLib pkgs;
pkgs = nixpkgs.legacyPackages.${system}.extend rust-overlay.overlays.default;
craneLib = (crane.mkLib pkgs).overrideToolchain (p:
# Build tools
# We use the rust-overlay to get the stable Rust toolchain for various targets.
# This is not exactly necessary, but it allows for compiling for various targets
# with the least amount of friction.
p.rust-bin.nightly.latest.default.override {
extensions = ["rustfmt" "rust-analyzer" "clippy"];
targets = [];
});
src = let
fs = lib.fileset;
@ -97,8 +110,6 @@
postgresql_18
taplo
(rustfmt.override {asNightly = true;})
clippy
cargo-nextest
];
};

View file

@ -1,4 +1,7 @@
{pkgs, self}:
{
pkgs,
self,
}:
pkgs.testers.nixosTest {
name = "fc-api-crud";

View file

@ -1,4 +1,7 @@
{pkgs, self}:
{
pkgs,
self,
}:
pkgs.testers.nixosTest {
name = "fc-auth-rbac";

View file

@ -1,4 +1,7 @@
{pkgs, self}:
{
pkgs,
self,
}:
pkgs.testers.nixosTest {
name = "fc-basic-api";

View file

@ -1,4 +1,7 @@
{pkgs, self}:
{
pkgs,
self,
}:
pkgs.testers.nixosTest {
name = "fc-e2e";

View file

@ -1,4 +1,7 @@
{pkgs, self}:
{
pkgs,
self,
}:
pkgs.testers.nixosTest {
name = "fc-features";

View file

@ -1,4 +1,7 @@
{pkgs, self}:
{
pkgs,
self,
}:
pkgs.testers.nixosTest {
name = "fc-service-startup";

View file

@ -1,4 +1,7 @@
{pkgs, self}:
{
pkgs,
self,
}:
pkgs.testers.nixosTest {
name = "fc-webhooks";