nixfmt icon indicating copy to clipboard operation
nixfmt copied to clipboard

nixfmt converts symbolic links to a copy

Open badcold opened this issue 7 months ago • 3 comments

I've tried to reformat my machine's configuration.nix, which was a symbolic link and it made a copy of the file at the link's location.

[badcold@i7-3770k:~/demo]$ nixfmt --version
nixfmt nixpkgs-unstable-2025-04-04

[badcold@i7-3770k:~/demo]$ ls -la
total 16
drwxr-xr-x  4 badcold users 4096 Jun  9 11:11 .
drwx------ 72 badcold users 4096 Jun  9 11:10 ..
drwxr-xr-x  7 badcold users 4096 Jun  9 11:11 .git
drwxr-xr-x  2 badcold users 4096 Jun  9 11:10 elsewhere
lrwxrwxrwx  1 badcold users   18 Jun  9 11:11 test.nix -> elsewhere/test.nix

[badcold@i7-3770k:~/demo]$ nixfmt test.nix

[badcold@i7-3770k:~/demo]$ ls -la
total 20
drwxr-xr-x  4 badcold users 4096 Jun  9 11:12 .
drwx------ 72 badcold users 4096 Jun  9 11:10 ..
drwxr-xr-x  7 badcold users 4096 Jun  9 11:11 .git
drwxr-xr-x  2 badcold users 4096 Jun  9 11:10 elsewhere
-rw-r--r--  1 badcold users  120 Jun  9 11:12 test.nix

badcold avatar Jun 09 '25 09:06 badcold