Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The generated hardware-configuration file has CRLF terminators #438

Open
plietar opened this issue Dec 17, 2024 · 1 comment
Open

The generated hardware-configuration file has CRLF terminators #438

plietar opened this issue Dec 17, 2024 · 1 comment

Comments

@plietar
Copy link

plietar commented Dec 17, 2024

If I run nixos-anywhere with --generate-hardware-config nixos-generate-config hardware-configuration.nix, the produced file has CRLF terminators, which I would not normally expect.

$ nix run github:nix-community/nixos-anywhere -- --flake '.#<hostname>' root@<hostname> --generate-hardware-config nixos-generate-config hardware-configuration.nix --phases "kexec"
$ file hardware-configuration.nix
hardware-configuration.nix: Unicode text, UTF-8 text, with CRLF line terminators

While it is certainly not a big issue (Nix doesn't care about line termination) and I can easily work around it, it is surprising and causes large diffs if I compare the file to a previous version I had generated not with nixos-anywhere.

I've tracked the issue down to the usage of -t in the ssh options:

$ ssh root@<hostname> nixos-generate-config --show-hardware-config --no-filesystems | file -
/dev/stdin: Unicode text, UTF-8 text
$ ssh -t root@<hostname> nixos-generate-config --show-hardware-config --no-filesystems | file -
/dev/stdin: Unicode text, UTF-8 text, with CRLF line terminators
@sedlund
Copy link
Contributor

sedlund commented Dec 23, 2024

This should be fixed on main branch. If you would like to test, please do so and close this issue accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants