logoalt Hacker News

yokoprimetoday at 10:57 AM3 repliesview on HN

I struggle to see a valid usecase for this that isn’t handled by symlinks.


Replies

rnhmjojtoday at 3:27 PM

Hi, author here: whether it's a valid use case depends on your level of OCD, but the difference compared to symlinks or bind mounts is that you will have a clean home: e.g. `ls -la` won't show any "hidden" files.

Also, completely unrelated to my motivation, someone pointed out that modetc could be used to quickly hotfix packages built with Nix. Say that you need to fix a CVE in openssl, normally that would require to rebuild all dependent packages, which takes a long time. Instead with something like modetc you could build just openssl and rewrite /nix/store/<hash>-openssl-3.6.0/ -> /nix/store/<hash>-openssl-3.6.0-hotfix/.

Another application might be replacing some configuration file with placeholders for secrets, with one file with the secrets substituted in, without having to modify it in place, possibly only for a specific UID. This is something you might find useful on NixOS.

regularfrytoday at 11:10 AM

If I symlink ~/.ssh -> ~/.config/ssh, I still have .ssh in my ~. Whereas if I rewrite it, I don't.

show 1 reply
user3939382today at 1:21 PM

The use case is that you can actually use your home directory without either (a) hiding files or (b) wading through 40 config files and dirs that XDG ignorant devs put there.