!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

891 Members
179 Servers

Load older messages


SenderMessageTime
25 Jul 2023
@eigrp:matrix.orgeric joined the room.01:21:17
@federicodschonborn:matrix.org@federicodschonborn:matrix.org changed their profile picture.01:56:54
@moots:matrix.orgmootshow do i crossbuild a flake nixosconfiguration to aarch64 from x86 on none nixos? 16:41:18
@moots:matrix.orgmoots

 flake.nixosConfigurations."naked-oci" = withSystem "aarch64-linux" (ctx@{ pkgs,config, inputs', ... }:
    inputs.nixpkgs.lib.nixosSystem {
      # Expose `packages`, `inputs` and `inputs'` as module arguments.
      # Use specialArgs permits use in `imports`.
      # Note: if you publish modules for reuse, do not rely on specialArgs, but
      # on the flake scope instead. See also https://flake.parts/define-module-in-separate-file.html
      specialArgs = {
        packages = config.packages;
        inherit inputs inputs';
        pkgs = pkgs.pkgsCross.aarch64-multiplatform;
      };
      modules = [
        # This module could be moved into a separate file; otherwise we might
        # as well have used ctx.config.packages directly.
        ({ config, lib, packages, pkgs, ... }: {
          imports = [
    inputs.disko.nixosModules.disko
  ];
nixpkgs.hostPlatform = "aarch64-linux";

...

tried like that error: a 'aarch64-linux' with features {} is required to build '/nix/store/8zwd7397wqs1dsw6j3v11jkfaivlspc3-aarch64-unknown-linux-gnu-binutils-wrapper-2.40.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, kvm, nixos-test, uid-range}

16:42:26
@ulli:hrnz.li@ulli:hrnz.lijust like you would to without flakes. Flakes do nothing for cross-compilation16:42:54
@ncfavier:matrix.orgnf changed their profile picture.16:43:10
@ulli:hrnz.li@ulli:hrnz.li(i.e. use a nixpkgs instantiated with the correct build and host platforms)16:43:57
@ulli:hrnz.li@ulli:hrnz.liif you don't pass pkgs to nixosSystem, you can use the nixpkgs nixos module for that16:44:15
@ulli:hrnz.li@ulli:hrnz.liif you do pass pkgs to nixosSystem, this pkgs needs to be correctly instantiated16:44:34
@moots:matrix.orgmootshmm guess i have to dig into flake-parts16:48:06
@moots:matrix.orgmootscause im not sure where i can edit the pkgs var which it uses16:51:10
@ulli:hrnz.li@ulli:hrnz.liyou want to pass pkgs directly to nixosSystem, and not inside specialArgs (which will probably be ignored)16:56:02
@2xsaiko:tchncs.de@2xsaiko:tchncs.de

moots: hrnz already said it, but specifically you should just be able to set these nixos options and that's all you need, keep the rest like a non-cross system

{
  nixpkgs.buildPlatform = "x86_64-linux";
  nixpkgs.hostPlatform = "aarch64-linux";
}
17:16:39
@2xsaiko:tchncs.de@2xsaiko:tchncs.deI feel like setting pkgs like that will prevent e.g. nixpkgs.overlays from working17:17:04
@ulli:hrnz.li@ulli:hrnz.liyes, when pkgs is passed to nixosSystem, everything in the nixpkgs nixos-module won't have any effect anymore17:17:54
@moots:matrix.orgmoots
In reply to @2xsaiko:tchncs.de

moots: hrnz already said it, but specifically you should just be able to set these nixos options and that's all you need, keep the rest like a non-cross system

{
  nixpkgs.buildPlatform = "x86_64-linux";
  nixpkgs.hostPlatform = "aarch64-linux";
}
that doesnt work, and i havent figured out yet how to change nixpkgs before its passed to the nixos config when using flake-parts withsystem
17:21:55
@ulli:hrnz.li@ulli:hrnz.liI use https://git.hrnz.li/Ulli/nixos/src/branch/main/hosts/flake-module.nix#L104 and it works like a charm17:23:20
@2xsaiko:tchncs.de@2xsaiko:tchncs.deoh interesting, is there a reason to explicitly set config like that? I just have these for armv7l: https://git.dblsaiko.net/systems/tree/configurations/turris/default.nix#n3517:27:09
@moots:matrix.orgmoots
In reply to @ulli:hrnz.li
I use https://git.hrnz.li/Ulli/nixos/src/branch/main/hosts/flake-module.nix#L104 and it works like a charm
works i think
17:27:34
@2xsaiko:tchncs.de@2xsaiko:tchncs.deand I assume "doesn't work" means it doesn't try to cross-compile with just those? that's weird17:28:25
@moots:matrix.orgmoots
In reply to @ulli:hrnz.li
I use https://git.hrnz.li/Ulli/nixos/src/branch/main/hosts/flake-module.nix#L104 and it works like a charm
* works i think :)
17:27:36
@2xsaiko:tchncs.de@2xsaiko:tchncs.dewait, you're just calling nixpkgs.lib.nixosSystem yourself from what you sent, then this should have nothing to do with flake-parts17:31:17
@moots:matrix.orgmoots
In reply to @2xsaiko:tchncs.de
and I assume "doesn't work" means it doesn't try to cross-compile with just those? that's weird
i didnt had it as argument to the function, but as part of the configuration
17:30:00
@2xsaiko:tchncs.de@2xsaiko:tchncs.de I think you'll want to add inherit (pkgs) system; in your nixosSystem call though 17:31:53
@moots:matrix.orgmoots

like
had it like
{ nixpkgs.buildPlatform = "x86_64-linux";
nixpkgs.hostPlatform = "aarch64-linux";

Oracle Cloud uses EFI boot

boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;

}

17:30:43
@moots:matrix.orgmoots *

like
had it like

{
  nixpkgs.buildPlatform = "x86\_64-linux";
nixpkgs.hostPlatform = "aarch64-linux";

# Oracle Cloud uses EFI boot

boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;

}
17:30:53
@moots:matrix.orgmoots

not like

{  
  # Oracle Cloud uses EFI boot
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;
} {nixpkgs.buildPlatform = "x86_64-linux";
  nixpkgs.hostPlatform = "aarch64-linux";
}
17:31:14
@moots:matrix.orgmootsyeah i was confused cause flake-parts withsystem sets smth for nixpkgs17:32:16
@moots:matrix.orgmootseither way it doesnt work for me rn :(17:32:25
@moots:matrix.orgmoots

error: builder for '/nix/store/cwjscarzmmrdhjbsqvwp21qxwnk2sr4q-aarch64-unknown-linux-gnueabihf-stage-static-gcc-12.2.0.drv' failed with exit code 2;
       last 10 log lines:
       > checking for O_CLOEXEC... yes
       > checking for AF_UNIX... yes
       > checking for AF_INET6... yes
       > checking for _LK_LOCK... no
       > checking if mkdir takes one argument... no
       > This target does not support --with-float.
17:32:37

Show newer messages


Back to Room ListRoom Version: 6