Closed NANASHI0X74 closed 3 years ago
I'm a little foggy on it, but I believe I did this because I didn't want strings to be coerced into paths, because relative paths would be coerced into the nix store. That said, this doesn't apply everywhere (e.g. where absolute paths are concerned), and the reasoning may have been based on a misconception I never bothered to correct. I'll look into it.
Hi!
I'm restructuring my nixos configurations and migrating to using flakes and used this as a reference, both to copy parts of code from and to learn some design patterns and generally things about nixos.
Now I'm trying to read and understand the code, and I've noticed that this let seems unnecessary: https://github.com/hlissner/dotfiles/blob/1173284b76561d41edcb17062badccda012f7f2e/modules/options.nix#L9
According to https://nixos.org/manual/nixos/stable/index.html#sec-option-types-basic,
types.path
is defined asA filesystem path, defined as anything that when coerced to a string starts with a slash.
So that should already include str, right? Or am I missing something?