Pointed out to me today by a coworker:
[connorbaker@nixos-desktop:~]$ nix eval nixpkgs#path --apply '(path: path)' /nix/store/xnjw9gmfmpppdj6bxpw6cfkspc3h6xwl-source [connorbaker@nixos-desktop:~]$ nix eval nixpkgs#path --apply '(path: "${path}")' "/nix/store/6hqgw3kmvcv4glqqs64idkwvp7zx0c11-xnjw9gmfmpppdj6bxpw6cfkspc3h6xwl-source"
:(
(yes, it copies the entirety of nixpkgs from one path in the store to another path in the store)
>:(
A string interpolates to itself. A path in an interpolated expression is first copied into the Nix store, and the resulting string is the [store path] of the newly created store object .
A string interpolates to itself.
A path in an interpolated expression is first copied into the Nix store, and the resulting string is the [store path] of the newly created store object .
https://github.com/NixOS/nix/blob/723fdeb4f1bd7fad7c3b00603067d23c314b25c5/doc/manual/source/language/string-interpolation.md?plain=1#L153-L155