about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2025-04-20 09:07:23 +0300
committerVika <vika@fireburn.ru>2025-04-20 09:58:33 +0300
commit2ea9029faeb69d24e96c7167816e10824b5ffe7e (patch)
treeeb8ab5a2d2617bea2d4940d6c8e2cf659a17ba75
parentfced23a351446cb3566d1e82a7333074376ea54b (diff)
downloadkittybox-2ea9029faeb69d24e96c7167816e10824b5ffe7e.tar.zst
flake.nix: update cross-compilation notes
In newer versions of `crane`, cross-compilation ✨just works✨ with no
extra set-up required. It's nice to see the Nix cross-compilation story
improving.

Change-Id: Ib3d0cc965a08d517b5526154dcd9afa40a98fc7c
-rw-r--r--flake.nix6
1 files changed, 3 insertions, 3 deletions
diff --git a/flake.nix b/flake.nix
index f820e51..81eee80 100644
--- a/flake.nix
+++ b/flake.nix
@@ -20,14 +20,14 @@
       overlays = [ rust-overlay.overlays.default ];
       localSystem = { inherit system; };
     };
+    # NOTE: `pkgs` here must match `pkgs` used for `callPackage` to ensure
+    # cross-compilation works. Crane sets the requisite variables automatically.
     crane' = crane.mkLib pkgs;
     cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
     crane-msrv' = crane'.overrideToolchain (p: p.rust-bin.stable."${cargoToml.package.rust-version}".default);
 
     kittybox = pkgs.callPackage ./kittybox.nix {
-      # TODO: this may break cross-compilation. It may be better to
-      # inject it as an overlay. However, I am unsure whether Crane
-      # can recognize it's being passed a cross-compilation set.
+      # NOTE: See above re: cross-compilation.
       crane = crane';
 
       nixosTests = {