Closed dasJ closed 2 years ago
cc @ajs124 @Infinisil @Scriptkiddi @Ma27 @Lassulus
@dasJ great! Any plan of attack, or just track it here and people can chip away at it?
BTW - I noticed services.wordpress.commonOptions
but no such option exists that I'm aware of.
@aanderse I'd love to attack this somehow, but as I honestly don't have any idea what most modules do, I'm too afraid to break anything. I'd love people to chip away at it, and I'll try to do as much as I can.
As for the Wordpress options: I accidentially added our company modules into the list. I'm currently regenerating it ;)
I looked at some of those options to try and type them. I ran into an interesting situation with services.tor.tsocks.config
: the implementation of the module sets this option by itself, which means that if the user uses it, NixOS does the default thing which appears to be to concatenate everything together without separators, in the style of types.string
. (as opposed to types.str
which cant be merged) I concluded that, if we want to put a type on such an option while preserving its behavior by oral contract, the deprecated types.string
is what should be used. Of course every option should be looked at case-by-case. (Also I think the tsocks
module should be nuked at some point.)
I'm working on my branch here. Do we want to centralize at least the trivial cases somewhere instead of opening loads of small PRs?
@aanderse I finally regenerated the list and updated the command to make it usable for everyone
@lourkeur Yeah, I think that some larger PRs (like #76551 which fixes all nagios options at once) would be a lot easier to merge.
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
Updated command: curl -L https://hydra.nixos.org/job/nixos/trunk-combined/nixos.options/latest/download/1/options.json | jq -r 'to_entries[] | select(.value.type == "unspecified") | .key | "- [ ] " + .'
result:
That's good progress but it's not all done.
Related: #91813
was this closed intentionally or by accident?
Thanks to some newfound motivation for this issue (and procrastination from my regular work :eyes:) I chose to redo my generation code (goes from master instead of the release branch now) and reopen this. Good news is that a lot of the items are already fixed so I'm going to just replace the list above.
Update: List now includes clickable links
Probably cc @Infinisil do you have any idea why services.compton
shows up here? It's mkAliasOptionModule
'd to services.picom
but the type does not seem to be properly applied (showing as types.unspecified
).
@dasJ Isn't types.unspecified
what your script looks for?
Yes that's why I'm wondering. Shouldn't the type be the same as the type of services.picom
? Or is the type implicit unspecified because it's not a real option?
Oh I see the problem: The mkAliasOptionModule
code just tries to get the type from options.services.picom.type
, which in this case doesn't exist, because services.picom
isn't an option, it's just an attribute set of options.
@dasJ Fixing that in https://github.com/NixOS/nixpkgs/pull/110392 :)
I think this change will have one downside. Some options might be taking function as an argument. In these cases the underlying implementation within module does the passing of value into this function. Many of these functions are not covered by test suite and will fail during rebuild of systems while not being fixable by users without defining overlays. I think errors like can happen way too easily. See for instance https://github.com/NixOS/nixpkgs/pull/111451#discussion_r567434993
I'm not saying that I'm strictly against these changes but I think we need to take this to account and try to minimize the risk of introducing similar regressions. Putting runtime type checks on options is simply not like turning nix to statically typed language.
I think this change will have one downside. Some options might be taking function as an argument. In these cases the underlying implementation within module does the passing of value into this function. Many of these functions are not covered by test suite and will fail during rebuild of systems while not being fixable by users without defining overlays. I think errors like can happen way too easily. See for instance #111451 (comment)
I'm not saying that I'm strictly against these changes but I think we need to take this to account and try to minimize the risk of introducing similar regressions. Putting runtime type checks on options is simply not like turning nix to statically typed language.
I actually have only encountered a handful of options like this, I reverted changes where I probably did the same error. Let's see what the solution for the xmonad issue is going to be an see if we can apply that to the last remaining options.
I marked this as stale due to inactivity. → More info
Still relevant, and my #132448 should help with this
@dasJ could you regenerate the list? some things are out of date
Done
Describe the bug
To make the usage of options and errors more clear, every option should have a type. Currently,
more than 300 199 151 117 27 2018 options don't have a type.To Reproduce Steps to reproduce the behavior:
Expected behavior
All options should have a type.
Additional context
Options without types:
dysnomia.components
- nixos/modules/services/misc/dysnomia.nix → #149416dysnomia.containers
- nixos/modules/services/misc/dysnomia.nix → #149416dysnomia.extraContainerPaths
- nixos/modules/services/misc/dysnomia.nix → #149416dysnomia.extraContainerProperties
- nixos/modules/services/misc/dysnomia.nix → #149416dysnomia.extraModulePaths
- nixos/modules/services/misc/dysnomia.nix → #149416dysnomia.properties
- nixos/modules/services/misc/dysnomia.nix → #149416hardware.pcmcia.config
- nixos/modules/hardware/pcmcia.nix → #149415security.pam.loginLimits
- nixos/modules/security/pam.nix → #149412security.pam.services.<name>.limits
- nixos/modules/security/pam.nix → #149412services.hoogle.haskellPackages
- nixos/modules/services/development/hoogle.nix → #149415services.nsd.zones.<name>.children
- nixos/modules/services/networking/nsd.nix → #149415services.unbound.stateDir
- nixos/modules/services/networking/unbound.nix → #141730services.vsftpd.userlist
- nixos/modules/services/networking/vsftpd.nix → #111441services.xserver.displayManager.session
- nixos/modules/services/x11/display-managers/default.nix → #141760services.xserver.windowManager.xmonad.haskellPackages
- nixos/modules/services/x11/window-managers/xmonad.nix → #149415specialisation.<name>.configuration
- nixos/modules/system/activation/top-level.nix → #143207