home-manager: adds configurable symlink/bindfs option #99
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello, all! A huge thanks to the maintainers :), I've been using impermanence for a while and really love it.
As mentioned in #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 havemethod = "symlink"
as well.I made sure that changing between the two methods works reliably. For that end, I've added:
cleanEmptyLinkTargets
activation script that handles changing from bindfs to symlink. If a link's intended location has something mounted, it is unmounted (earlier than usual) and its mount point is deleted (safely withrm -d
).mount | grep
condition on the usual unmount phase, to avoid systemd trying to unmount a symlink (causes error messagens and a few seconds of hanging, although it ultimately works).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 tomkUnmount
was adding themount | 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