| 18 Mar 2025 |
fzakaria | to avoid "mass rebuilds" -- it's so fragile. I tried moving things to overlay and too much borked | 19:16:18 |
| 19 Mar 2025 |
| Sergei Zimmerman (xokdvium) changed their display name from xokdvium to Sergei Zimmerman (xokdvium). | 21:12:18 |
| 21 Mar 2025 |
| Domen Kožar changed their profile picture. | 11:41:12 |
| 24 Mar 2025 |
rhelmot | I'm having trouble parsing the logic behind hostOffset in setup hooks. Is the idea that if I'm currently running for a package that was brought in as a buildInput it'll be 0 and if it's a nativeBuildInput it'll be 1? | 01:52:53 |
John Ericson | -1 for native build input iirc? | 03:09:34 |
John Ericson | But I could forget | 03:09:38 |
| 26 Mar 2025 |
@rosssmyth:matrix.org | Is there an example somewhere of where multilib + crosspkgs is broken? From #380325
What would it take to fix it?
| 18:57:13 |
| n3tcat joined the room. | 18:57:22 |
| n3tcat | 19:00:25 |
| n3tcat | 19:01:16 |
n3tcat | Hello! I'm new to cross-compiling on NixOS. I want to compile C code for my custom M68k computer.
This is what my flake.nix file currently looks like:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils?ref=main";
};
outputs =
inputs:
inputs.flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
packages = (
with pkgs; [
minipro
gnumake
pkgsCross.m68k.buildPackages.gcc
xxd
]
);
};
}
);
}
I think I want to remove the pkgsCross.m68k line and add in crossSystem pointing at this patch from K900: https://github.com/K900/nixpkgs/commit/e8d4e76093cd396805e76c908734a351cc6d1f39
But I'm not really clear on what I'm actually doing (plus I want my other packages to not be cross-compiled as I want to run them on my x86 box) | 19:04:42 |
K900 | Easiest is probably to just cherry-pick that patch into your own nixpkgs fork | 19:06:20 |
K900 | And then it should work | 19:06:25 |
K900 | I think | 19:06:26 |
n3tcat | I guess I don't really know what needs to go in the flake.nix file to start, even if I point it at my custom nixpkgs repo | 19:06:49 |
K900 | Oh | 19:07:00 |
n3tcat | Like so that I have access to an m68k cross compiler for my C code | 19:07:02 |
K900 | We don't have an m68k-unknown-elf platform do we | 19:07:08 |
K900 | Then something like
let pkgsCrossM68k = import inputs.nixpkgs { system = "x86_64-linux"; cross-system = "m68k-unknown-none-elf"; }; in pkgs.mkShell { ... packages = [ pkgsCrossM68k.stdenv.cc ]; }
| 19:08:12 |
n3tcat | ahh I see | 19:08:38 |
n3tcat | thank you this is super helpful | 19:08:43 |
n3tcat | Should that override cc? cc -march=68000 mandelbrot.c says the arch isn't supported. I'm not seeing anything under m68k-* either | 19:13:57 |
K900 | Uhh | 19:19:46 |
K900 | Can you post the whole thing | 19:19:48 |
K900 | It should be prefixed | 19:19:56 |
n3tcat | {
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils?ref=main";
};
outputs =
inputs:
inputs.flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
pkgsCrossM68k = import "/home/stephen/src/k900/nixpkgs" {
system = "x86_64-linux"; cross-system = "m68k-unknown-none-elf";
};
in
{
devShells.default = pkgs.mkShell {
packages = (
with pkgs; [
minipro
gnumake
xxd
pkgsCrossM68k.stdenv.cc
]
);
};
}
);
}
I'm doing nix develop --impure for now. I'll fix the path once things are good | 19:20:59 |
K900 | It's crossSystem | 19:22:02 |
K900 | And yes it takes arbitrary args don't ask | 19:22:09 |
n3tcat | well it's hanging and my cpu is at 100% so it's probably building | 19:26:57 |
n3tcat | yippee this is cool | 19:27:05 |