nix-community / impermanence

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

nixos: Create persistent storage directories and their parents #193

Open talyz opened 2 weeks ago

talyz commented 2 weeks ago

If they're not filesystem roots, they won't exist when deploying to a new system and would otherwise have to be manually created.

Fix #154

cc @tmarkov

tmarkov commented 2 weeks ago

I'll try to try this tomorrow. Out of curiosity, why isn't simply passing -p to mkdir good enough?

talyz commented 2 weeks ago

It opens up for directories being created with the wrong permissions and ownership if they're created in the wrong order. You would always have to consider the possible side effects of it, basically. Explicitly creating all directories in the hierarchy gives much better control and makes potential issues easier to pinpoint.

visualphoenix commented 2 weeks ago

any reason why this removes quoting in the bash part?

tmarkov commented 1 week ago

Sorry for the delay, had trouble setting up a test vm properly.

But everything seems to work fine (at least on my config).