Hey, new user, no chance of losing me. I’ve searched nixos wiki (Build flags) and the web but it can’t pinpoint this problem.
This is a fresh installation on which I initially added a bunch of unconfigured package names (userland mostly) that do nothing yet.
I’ve tried setting gcc.arch and system-features. Running “nixos-rebuild switch --use-remote-sudo” failed before build starts as follows, which is the main problem I’m having:
error: a 'x86_64-linux' with features {gccarch-broadwell} is required to build '/nix/store/4szk0nzwps00kf8wrv6g2rzwrjn8wfdb-git-2.47.2.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, kvm, nixos-test}
The relevant /etc/nixos/configuration.nix added for these attempts looks like this:
# Build from source, when false
nix.settings.substitute = false;
# Included sources, when true
system.includeBuildDependencies = true;
# Include the 4 default features plus the gccarch-* feature
nix.settings.system-features = [
"benchmark"
"big-parallel"
"nixos-test"
"kvm"
"gccarch-broadwell"
];
nixpkgs.hostPlatform = {
gcc.arch = "broadwell";
gcc.tune = "broadwell";
system = "x86_64-linux";
};
Following that error I’m able to start compilation using…
sudo -Hi
nixos-rebuild switch --option system-features gccarch-broadwell
… which, to start compilation, required both the dedicated root user and the options… but it fails after many hours with a combination of two errors, one similar to the above but asking for features {gccarch-broadwell, big-parallel}
complaining it only provides {gccarch-broadwell}
, and then a second error right after which matches exactly the prior error (so two sets of feature incompatibilities, 2 errors, sorry lost the log, and the second error implied the --option system-features gccarch-broadwell
part was still insufficient to address the original issue).
I’ve also tried the following, which failed with the original error:
nixos-rebuild switch --option system-features "[ gccarch-broadwell benchmark big-parallel nixos-test kvm ]"
In order of importance:
- What are the current official procedures to recompile the entire OS and packages from source using gcc.arch? (wonderful feature)
- Do I have to manually clean the store somehow before rebuilding from source? Missing step?
- Do you need
nix.settings.system-features
in /etc/nixos/configuration.nix at all? - Why does setting
nix.settings.system-features
in /etc/nixos/configuration.nix do nothing in this case? - If you do need
nix.settings.system-features
, do you have to specify the 4 default ones, or can you just putgccarch-*
alone and not destroy the default configuration? (I thought the list appends, but examples on the web add the 4 defaults, which seems distasteful) - Is there a way to do this where you don’t have to pass
--option system-features gccarch-broadwell
on the command-line? It seems required to set up the compiler. - Was this syntax correct:
nixos-rebuild switch --option system-features "[ gccarch-broadwell benchmark big-parallel nixos-test kvm ]"
?
Thanks if anyone knows what I missed