impermanence icon indicating copy to clipboard operation
impermanence copied to clipboard

nixos: types.str -> types.path

Open winterqt opened this issue 3 years ago • 5 comments

winterqt avatar Dec 31 '21 00:12 winterqt

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.

winterqt avatar Dec 31 '21 02:12 winterqt

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.

adisbladis avatar Jan 19 '22 05:01 adisbladis

@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?

winterqt avatar Jan 19 '22 05:01 winterqt

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!

adisbladis avatar Jan 19 '22 06:01 adisbladis

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.

talyz avatar Jan 19 '22 08:01 talyz