Skip to content

Commit

Permalink
fix(nixos-generate-config): dont ouput carriage returns in output files
Browse files Browse the repository at this point in the history
  • Loading branch information
sedlund committed Dec 18, 2024
1 parent f9d38ca commit cb3fc23
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/nixos-anywhere.sh
Original file line number Diff line number Diff line change
Expand Up @@ -448,19 +448,19 @@ generateHardwareConfig() {
nixos-facter)
if [[ ${isInstaller} == "y" ]]; then
if [[ ${hasNixOSFacter} == "n" ]]; then
abort "nixos-facter is not available in booted installer. You may want to boot an installer image from here instead: https://github.com/nix-community/nixos-images"
abort "nixos-facter is not available in booted installer, use nixos-generate-config. For nixos-facter, you may want to boot an installer image from here instead: https://github.com/nix-community/nixos-images"
fi
else
maybeSudo=""
fi

step "Generating hardware-configuration.nix using nixos-facter"
# FIXME: if we take the output directly it adds some weird characters at the beginning
runSsh -o ConnectTimeout=10 ${maybeSudo} "nixos-facter" >"$hardwareConfigPath"
runSsh -o ConnectTimeout=10 "stty nl; ${maybeSudo} nixos-facter" >"$hardwareConfigPath"
;;
nixos-generate-config)
step "Generating hardware-configuration.nix using nixos-generate-config"
runSsh -o ConnectTimeout=10 nixos-generate-config --show-hardware-config --no-filesystems >"$hardwareConfigPath"
runSsh -o ConnectTimeout=10 "stty nl; nixos-generate-config --show-hardware-config --no-filesystems" >"$hardwareConfigPath"
;;
*)
abort "Unknown hardware config backend: $hardwareConfigBackend"
Expand Down

0 comments on commit cb3fc23

Please sign in to comment.