File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -944,6 +944,27 @@ echo "extra-trusted-public-keys = ${trustedPublicKeys}" >> ~/.config/nix/nix.con
944944SSH
945945 fi
946946
947+ # Get system-features with a specific cpu architecture from the machine and add them to the installer
948+ if [[ -n ${flake} ]]; then
949+ system_features=$( nix --extra-experimental-features ' nix-command flakes' eval --apply toString " ${flake} " # "${flakeAttr}".nix.settings.system-features)
950+ if [[ -z ${system_features} ]]; then
951+ system_features=$( nix config show system-features)
952+ fi
953+
954+ platform_arch=$( nix --extra-experimental-features ' nix-command flakes' eval --apply ' x: toString (x.nixpkgs.hostPlatform.gcc.arch or "")' " ${flake} #${flakeAttr} " )
955+ if [[ -n ${platform_arch} ]]; then
956+ system_features=" ${system_features} gccarch-${platform_arch} "
957+ fi
958+
959+ # deduplicate the features
960+ system_features=$( echo " ${system_features} " | tr ' ' ' \n' | sort -u | tr ' \n' ' ' | sed ' s/ $//' )
961+
962+ runSsh sh << SSH || true
963+ mkdir -p ~/.config/nix
964+ echo "system-features = ${system_features} " >> ~/.config/nix/nix.conf
965+ SSH
966+ fi
967+
947968 if [[ ${phases[disko]} == 1 ]]; then
948969 runDisko " $diskoScript "
949970 fi
You can’t perform that action at this time.
0 commit comments