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": { "root": {
"inputs": { "inputs": {
"crane": "crane", "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 = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixpkgs-unstable"; nixpkgs.url = "github:NixOS/nixpkgs?ref=nixpkgs-unstable";
crane.url = "github:ipetkov/crane"; crane.url = "github:ipetkov/crane";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { outputs = {
nixpkgs, nixpkgs,
crane, crane,
self, self,
rust-overlay,
... ...
}: let }: let
inherit (nixpkgs) lib; inherit (nixpkgs) lib;
@ -20,8 +25,16 @@
}; };
packages = forAllSystems (system: let packages = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system}.extend rust-overlay.overlays.default;
craneLib = crane.mkLib pkgs; 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 src = let
fs = lib.fileset; fs = lib.fileset;
@ -97,8 +110,6 @@
postgresql_18 postgresql_18
taplo taplo
(rustfmt.override {asNightly = true;})
clippy
cargo-nextest cargo-nextest
]; ];
}; };

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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