!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

555 Members
117 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
19 Aug 2025
@artturin:matrix.orgArtturinin systemPackages15:17:58
@quadradical:federated.nexusQuadRadical (Ping) hmm what is ... here? 15:20:41
@quadradical:federated.nexusQuadRadical (Ping) what is pkgs.path? 15:20:47
@artturin:matrix.orgArtturin
nix-repl> pkgs.path
/home/art/nixgits/my-nixpkgs
15:21:10
@quadradical:federated.nexusQuadRadical (Ping)oh i see15:21:20
@quadradical:federated.nexusQuadRadical (Ping)i can just use my nixpkgs input presumably too15:21:31
@artturin:matrix.orgArtturinyeah, pkgs.path refers to that15:21:39
@artturin:matrix.orgArtturin

all-packages.nix

# For convenience, allow callers to get the path to Nixpkgs.
path = ../..;
15:22:17
@quadradical:federated.nexusQuadRadical (Ping)ah nice15:22:32
@quadradical:federated.nexusQuadRadical (Ping)hmm15:22:34
@quadradical:federated.nexusQuadRadical (Ping)i wonder if its even worth me doing cross at all15:22:40
@quadradical:federated.nexusQuadRadical (Ping)am i better off to do binfmt for everything so i can get the binary cache?15:22:50
@artturin:matrix.orgArtturinI don't use binfmt15:22:51
@artturin:matrix.orgArtturin { crossSystem = lib.systems.examples.aarch64-multiplatform; } 15:25:28
@artturin:matrix.orgArtturin or crossSystem = "aarch64-unknown-linux-gnu" or crossSystem.config = "aarch64-unknown-linux-gnu" 15:27:05
@artturin:matrix.orgArtturinhttps://github.com/NixOS/nixpkgs/blob/master/lib/systems/examples.nix15:27:26
@quadradical:federated.nexusQuadRadical (Ping) thank you 17:00:59
@quadradical:federated.nexusQuadRadical (Ping)yeah i got that after you explained what pkgs.path is17:01:08
20 Aug 2025
@quadradical:federated.nexusQuadRadical (Ping) for binfmt though dont i have to set smth globally 00:42:05
@quadradical:federated.nexusQuadRadical (Ping)dont i need to set boot.binfmt.emulatedSystems?00:42:13
@quadradical:federated.nexusQuadRadical (Ping)maybe it would be easiest to build everything on binfmt except for a few packages00:44:34
@jopejoe1:matrix.orgjopejoe1 (4094@39c3) changed their display name from jopejoe1 (4094@GPN23) to jopejoe1.18:50:11
21 Aug 2025
@creepinson:matrix.org@creepinson:matrix.org joined the room.22:10:34
@emilazy:matrix.orgemily

Artturin: does this targetPackages stuff from Rust seem as dodgy stage-wise to you as it does me

      prefixForStdenv = stdenv: "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}";
      ccPrefixForStdenv =
        stdenv: "${prefixForStdenv stdenv}${if (stdenv.cc.isClang or false) then "clang" else "cc"}";
      cxxPrefixForStdenv =
        stdenv: "${prefixForStdenv stdenv}${if (stdenv.cc.isClang or false) then "clang++" else "c++"}";
      setBuild = "--set=target.${stdenv.buildPlatform.rust.rustcTarget}";
      setHost = "--set=target.${stdenv.hostPlatform.rust.rustcTarget}";
      setTarget = "--set=target.${stdenv.targetPlatform.rust.rustcTarget}";
      ccForBuild = ccPrefixForStdenv pkgsBuildBuild.targetPackages.stdenv;
      cxxForBuild = cxxPrefixForStdenv pkgsBuildBuild.targetPackages.stdenv;
      ccForHost = ccPrefixForStdenv pkgsBuildHost.targetPackages.stdenv;
      cxxForHost = cxxPrefixForStdenv pkgsBuildHost.targetPackages.stdenv;
      ccForTarget = ccPrefixForStdenv pkgsBuildTarget.targetPackages.stdenv;
      cxxForTarget = cxxPrefixForStdenv pkgsBuildTarget.targetPackages.stdenv;
22:29:41
@artturin:matrix.orgArtturin
In reply to @emilazy:matrix.org

Artturin: does this targetPackages stuff from Rust seem as dodgy stage-wise to you as it does me

      prefixForStdenv = stdenv: "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}";
      ccPrefixForStdenv =
        stdenv: "${prefixForStdenv stdenv}${if (stdenv.cc.isClang or false) then "clang" else "cc"}";
      cxxPrefixForStdenv =
        stdenv: "${prefixForStdenv stdenv}${if (stdenv.cc.isClang or false) then "clang++" else "c++"}";
      setBuild = "--set=target.${stdenv.buildPlatform.rust.rustcTarget}";
      setHost = "--set=target.${stdenv.hostPlatform.rust.rustcTarget}";
      setTarget = "--set=target.${stdenv.targetPlatform.rust.rustcTarget}";
      ccForBuild = ccPrefixForStdenv pkgsBuildBuild.targetPackages.stdenv;
      cxxForBuild = cxxPrefixForStdenv pkgsBuildBuild.targetPackages.stdenv;
      ccForHost = ccPrefixForStdenv pkgsBuildHost.targetPackages.stdenv;
      cxxForHost = cxxPrefixForStdenv pkgsBuildHost.targetPackages.stdenv;
      ccForTarget = ccPrefixForStdenv pkgsBuildTarget.targetPackages.stdenv;
      cxxForTarget = cxxPrefixForStdenv pkgsBuildTarget.targetPackages.stdenv;
I recall there being more of xPkgs.targetPackages in nixpkgs
23:43:06
@artturin:matrix.orgArtturin* I recall there being more of xPkgs.targetPackages.stdenv in nixpkgs23:44:30
22 Aug 2025
@corridor4572:matrix.orgRichInOverdraft joined the room.00:43:13
@emilazy:matrix.orgemilybut... is it wrong? :)10:57:33

Show newer messages


Back to Room ListRoom Version: 6