From 6d00f6216deeeaa980ca9cf63d3ca21174eaecbb Mon Sep 17 00:00:00 2001 From: Henri Bourcereau Date: Sat, 9 May 2026 09:32:10 +0200 Subject: [PATCH] fix: rust overlay in nix package --- container/flake.nix | 7 +++---- flake.nix | 9 ++++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/container/flake.nix b/container/flake.nix index 86b1559..84f8d13 100644 --- a/container/flake.nix +++ b/container/flake.nix @@ -2,9 +2,8 @@ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; # inputs.trictrac.url = "github:mmai/trictrac"; inputs.trictrac.url = ".."; - inputs.rust-overlay.url = "github:oxalica/rust-overlay"; - outputs = { self, nixpkgs, trictrac, rust-overlay }: + outputs = { self, nixpkgs, trictrac }: { nixosConfigurations = { @@ -30,8 +29,8 @@ networking.firewall.allowedTCPPorts = [ 80 ]; networking.hostName = hostname; - # rust-overlay must be applied first so trictrac.overlay can use rust-bin - nixpkgs.overlays = [ rust-overlay.overlays.default trictrac.overlay ]; + # trictrac.overlay already includes rust-overlay + nixpkgs.overlays = [ trictrac.overlay ]; services.trictrac = { enable = true; diff --git a/flake.nix b/flake.nix index 8adc0ba..586e2fc 100644 --- a/flake.nix +++ b/flake.nix @@ -8,13 +8,16 @@ outputs = { self, nixpkgs, rust-overlay }: let + rustPkgs = import nixpkgs { + inherit (final) system; + overlays = [ rust-overlay.overlays.default ]; + }; systems = [ "x86_64-linux" "i686-linux" "aarch64-linux" ]; forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); - # rust-overlay must be applied before self.overlay so that rust-bin is available nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; - overlays = [ rust-overlay.overlays.default self.overlay ]; + overlays = [ self.overlay ]; } ); in @@ -24,7 +27,7 @@ trictrac-front = let # WASM build needs wasm32-unknown-unknown target in the Rust toolchain - rustToolchain = final.rust-bin.stable.latest.default.override { + rustToolchain = rustPkgs.rust-bin.stable.latest.default.override { targets = [ "wasm32-unknown-unknown" ]; }; rustPlatform = final.makeRustPlatform {