Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

System for configuration is local system not the target system #31

Open
i1i1 opened this issue Apr 14, 2024 · 1 comment
Open

System for configuration is local system not the target system #31

i1i1 opened this issue Apr 14, 2024 · 1 comment

Comments

@i1i1
Copy link
Contributor

i1i1 commented Apr 14, 2024

I'm finding it weird that local system is used for nixpkgs here:

# using the same nixpkgs as nixos-rk3588 to utilize the cross-compilation cache.
inherit (nixos-rk3588.inputs) nixpkgs;
boardModule = nixos-rk3588.nixosModules.orangepi5;
# 1. for cross-compilation on x86_64-linux
system = "x86_64-linux";
# Compile the kernel using a cross-compilation tool chain
# Which is faster than emulating the target system.
pkgsKernel = import nixpkgs {
localSystem = "x86_64-linux";
crossSystem = "aarch64-linux";
};
# 2. for native compilation on aarch64-linux SBCs.
# system = "aarch64-linux";
# native compilation tool chain for the linux kernel
# pkgsKernel = nixpkgs;
in {
colmena = {
meta = {
nixpkgs = import nixpkgs {inherit system;};
rk3588 = {
inherit nixpkgs pkgsKernel;
};
};

Can you explain how it works, because if you remove colmena from the configuration and make it regular nixos configuration and try to crosscompile it would look like this:

nixpkgs.lib.nixosSystem {
  system = "x86_64-linux";
  modules = [
    nixos-rk3588.nixosModules.orangepi5.core
    nixos-rk3588.nixosModules.orangepi5.sd-image
    ./configuration.nix
  ];

  specialArgs.rk3588 = {
    inherit nixpkgs;
    pkgsKernel = import nixpkgs {
      localSystem = "x86_64-linux";
      crossSystem = "aarch64-linux";
    };
  };
}

Which is a bit weird, cause system is still aarch64-linux.

@i1i1
Copy link
Contributor Author

i1i1 commented Apr 14, 2024

Nevermind. It doesn't work as I described.

I've set nixosSystem as follows:

nixpkgs.lib.nixosSystem {
  system = "aarch64-linux";
  modules = [
    nixos-rk3588.nixosModules.orangepi5.core
    nixos-rk3588.nixosModules.orangepi5.sd-image
    ./configuration.nix
  ];

  specialArgs.rk3588 = {
    inherit nixpkgs;
    pkgsKernel = import nixpkgs {
      localSystem = "x86_64-linux";
      crossSystem = "aarch64-linux";
    };
  };
}

and used my orangepi 5 as remote builder (as described here) and everything worked flawlessly. Maybe example should be updated or I can add example featuring regular deployment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant