Remix.run Logo
yokoprime 10 hours ago

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

rnhmjoj 5 hours ago | parent | next [-]

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.

regularfry 9 hours ago | parent | prev | next [-]

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

hvenev 9 hours ago | parent [-]

Will you not have `~/.ssh`? If you have `.ssh .config/ssh` as a rewrite rule, `stat ~/.ssh` will still find it.

txtsd 9 hours ago | parent [-]

The point is to have a clean home directory.

jl6 8 hours ago | parent | next [-]

Abandon hope.

I just treat ~ as a system-owned configuration area, and put my actual files (documents, photos, etc.) in a completely different hierarchy under /.

SAI_Peregrinus 2 hours ago | parent | next [-]

"/home/${USER}" for whatever junk programs are going to stick there, "/home/${USER}/home" for my "real" home directory.

oftenwrong 5 hours ago | parent | prev [-]

I have been doing this for decades. My files are in a sub-directory of $HOME. It also makes it very obvious when a piece of software does not treat your $HOME with respect.

trollbridge 7 hours ago | parent | prev | next [-]

You could write a kernel module, then, that just hides certain symlinks from you (which is effectively what this module is).

ComputerGuru 4 hours ago | parent | prev | next [-]

On Windows this was always easier because, for some reason, most everyone respected %appdata% compared to XDG_CONFIG_HOME, but also because hidden files wasn’t just a naming convention but an actual separate metadata flag.

Sardtok 2 hours ago | parent [-]

Always... Except for the decades before this became common. Never a bloated C: root directory. Microsoft even had games store stuff in My Documents\Games at one point. My Documents was a user dir that saw a lot of abuse over the years.

SAI_Peregrinus an hour ago | parent [-]

They still have that, it's just `My Documents\My Games` now. And Visual Studio makes a folder in My Documents for every annual release. And…

Joker_vD 3 hours ago | parent | prev [-]

That ship has sailed 30 years ago.

user3939382 7 hours ago | parent | prev [-]

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.