nix-community / impermanence

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

nixos: types.str -> types.path #65

Open winterqt opened 2 years ago

winterqt commented 2 years ago

Hm, not sure if this is a good idea after thinking about it further. I'll leave it open just in case someone thinks differently.

adisbladis commented 2 years ago

I think path's are more "dangerous" as they are easier to mishandle than a string, where the mishandled case leads to copying the files to the store.

winterqt commented 2 years ago

@adisbladis Yeah, that was my reasoning for reconsidering this change. Strings are much harder to misuse in this case.

The main reason this change was proposed in the first place was that it provided a way to check for valid path syntax. How would you feel about changing this to add a check to the string types to check for things such as not being empty, requiring a leading slash, and not having a trailing slash?

adisbladis commented 2 years ago

How would you feel about changing this to add a check to the string types to check for things such as not being empty, requiring a leading slash, and not having a trailing slash?

That sounds very welcome to me!

talyz commented 2 years ago

This would be a bit more complicated with #70 in place, where paths in users shouldn't start with a slash, so user paths would have to have a different type/check. Definitely doable, though.