nix-community / impermanence

Modules to help you handle persistent state on systems with ephemeral root storage [maintainer=@talyz]
MIT License
1.03k stars 77 forks source link

home-manager: adds configurable symlink/bindfs option #99

Closed Misterio77 closed 1 year ago

Misterio77 commented 2 years ago

Hello, all! A huge thanks to the maintainers :), I've been using impermanence for a while and really love it.


As mentioned in https://github.com/nix-community/impermanence/issues/42, bindfs causes some issues with a few specific programs (steam, for example). I'm aware that we have options for using the NixOS module to avoid bindfs, but that may not be preferred (or possible) for some.

This PR allows for setting a specific method for each individual directory. They can (atm) be either "bindfs" (the default if not specified) or "symlink".

I've reused the code that links files, but now it runs on directories that have method = "symlink" as well.

I made sure that changing between the two methods works reliably. For that end, I've added:

~Oh, and by the way, git got a little confused with the repeated unmount code and messed up the diff. The only change I made to mkUnmount was adding the mount | grep check.~

As we have three places with the same unmount code now, I've factored it out to a function. Diff looks fine now.

Hope this is useful, and please let me know if there's anything to be improved!


Fixes #42

Misterio77 commented 1 year ago

No problem at all! Thank you for this awesome tool :)

could you rename path to directory

Done!

Misterio77 commented 1 year ago

Oops removed the review request by mistake, sorry

talyz commented 1 year ago

It still needs to be updated in the readme. Also, please squash the update into the previous commit.

Misterio77 commented 1 year ago

All done :)

talyz commented 1 year ago

Great work! Thank you!