Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

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

@i1i1

Description

@i1i1

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions