I have a NixOS systen configuration flake that I use for multiple hosts. It imports nixpkgs
like so:
{
description = "Main Flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
[...]
};
outputs = { self, nixpkgs, home-manager, nixvirt, ... }@inputs:
let
pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
};
in
{
nixosConfigurations.caprica = nixpkgs.lib.nixosSystem { [...] };
nixosConfigurations.aquaria = nixpkgs.lib.nixosSystem { [...] };
[...]
};
}
This works perfectly. Recently, I added a Raspberry Pi to my fleet (so aarch64-linux
instead of x86_64-linux
). I didn’t remember to update the architecture in the flake. And yet… it still works (nearly) perfectly. But how is that possible, since I’m declaring system = "x86_64-linux"
for all my systems?
The only reason I know there’s any kind of problem is that I happened to reference a ${pkgs.coreutils}
binary in a Home Manager module and that produced an error on the Raspberry Pi because it was the wrong architecture. I understand why it’s complaining about that, but I’m not sure how the rest of the system is functioning right now. Can anyone shed light? If it helps, my complete configuration is in this flake.nix in this repo. Thanks!