Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All options should have types #76184

Closed
12 of 16 tasks
dasJ opened this issue Dec 22, 2019 · 22 comments · Fixed by #162271
Closed
12 of 16 tasks

All options should have types #76184

dasJ opened this issue Dec 22, 2019 · 22 comments · Fixed by #162271
Labels
0.kind: bug Something is broken 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS

Comments

@dasJ
Copy link
Member

dasJ commented Dec 22, 2019

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 20 18 options don't have a type.

To Reproduce
Steps to reproduce the behavior:

let
  config = { };
  pkgs = import ./. {};
  lib = import ./lib;

  scrubDerivations = namePrefix: pkgSet: lib.mapAttrs
    (name: value:
      let wholeName = "${namePrefix}.${name}"; in
      if lib.isAttrs value then
        scrubDerivations wholeName value
        // (lib.optionalAttrs (lib.isDerivation value) { outPath = "\${${wholeName}}"; })
      else value
    )
    pkgSet;

  scrubbedEval = lib.evalModules {
    modules = import ./nixos/modules/module-list.nix;
    specialArgs = {
      pkgs = scrubDerivations "pkgs" pkgs;
    };
  };

  manual = import ./nixos/doc/manual {
    inherit config pkgs;
    inherit (scrubbedEval) options;
    version = "master";
    revision = "master";
  };
in manual.optionsJSON
jsonFile="$(NIX_PATH='' nix-build types.nix)/share/doc/nixos/options.json"
jq -r 'to_entries[] | select(.value.type == "unspecified") | [ "`" + .key + "`", "[" + .value.declarations[0] + "](../blob/master/" + .value.declarations[0] + ")" ] | join(" - ")' < "${jsonFile}" | sed 's/^\(.*\)$/- [ ] \1/g'

Expected behavior

All options should have a type.

Additional context

Options without types:

@dasJ dasJ added the 0.kind: bug Something is broken label Dec 22, 2019
@veprbl veprbl added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Dec 22, 2019
@dasJ
Copy link
Member Author

dasJ commented Dec 22, 2019

cc @ajs124 @infinisil @Scriptkiddi @Ma27 @Lassulus

@aanderse
Copy link
Member

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

@dasJ
Copy link
Member Author

dasJ commented Dec 23, 2019

@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 ;)

@bbjubjub2494
Copy link
Member

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?

@dasJ
Copy link
Member Author

dasJ commented Dec 29, 2019

@aanderse I finally regenerated the list and updated the command to make it usable for everyone

@dasJ
Copy link
Member Author

dasJ commented Dec 29, 2019

@lourkeur Yeah, I think that some larger PRs (like #76551 which fixes all nagios options at once) would be a lot easier to merge.

@stale
Copy link

stale bot commented Jun 28, 2020

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:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 28, 2020
@bbjubjub2494
Copy link
Member

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:

  • boot.crashDump.reservedMemory
  • boot.kernelPackages
  • dysnomia.components
  • dysnomia.containers
  • dysnomia.extraContainerPaths
  • dysnomia.extraContainerProperties
  • dysnomia.extraModulePaths
  • dysnomia.properties
  • hardware.pcmcia.config
  • networking.timeServers
  • nix.registry..flake
  • programs.cdemu.group
  • programs.cdemu.gui
  • programs.cdemu.image-analyzer
  • security.pam.loginLimits
  • security.pam.services.<name?>.limits
  • services.activemq.configurationDir
  • services.amule.dataDir
  • services.amule.user
  • services.autofs.timeout
  • services.babeld.extraConfig
  • services.bacula-dir.extraDirectorConfig
  • services.bacula-dir.extraMessagesConfig
  • services.bacula-dir.name
  • services.bacula-dir.password
  • services.bacula-fd.director..monitor
  • services.bacula-fd.director..password
  • services.bacula-fd.extraClientConfig
  • services.bacula-fd.extraMessagesConfig
  • services.bacula-fd.name
  • services.bacula-sd.autochanger..changerCommand
  • services.bacula-sd.autochanger..changerDevice
  • services.bacula-sd.autochanger..devices
  • services.bacula-sd.autochanger..extraAutochangerConfig
  • services.bacula-sd.device..archiveDevice
  • services.bacula-sd.device..extraDeviceConfig
  • services.bacula-sd.device..mediaType
  • services.bacula-sd.director..monitor
  • services.bacula-sd.director..password
  • services.bacula-sd.extraMessagesConfig
  • services.bacula-sd.extraStorageConfig
  • services.bacula-sd.name
  • services.bind.blockedNetworks
  • services.bind.cacheNetworks
  • services.bind.forwarders
  • services.bind.ipv4Only
  • services.bind.zones
  • services.bitlbee.extraDefaults
  • services.bitlbee.extraSettings
  • services.bitlbee.interface
  • services.bitlbee.portNumber
  • services.buildbot-master.pythonPackages
  • services.cgminer.config
  • services.cgminer.hardware
  • services.cgminer.pools
  • services.cgminer.user
  • services.chrony.initstepslew
  • services.chrony.servers
  • services.cntlm.domain
  • services.cntlm.noproxy
  • services.cntlm.port
  • services.cntlm.proxy
  • services.cntlm.username
  • services.compton
  • services.consul.extraConfig
  • services.deluge.openFilesLimit
  • services.elasticsearch-curator.actionYAML
  • services.felix.group
  • services.felix.user
  • services.firebird.baseDir
  • services.firebird.port
  • services.firebird.user
  • services.flashpolicyd.policy
  • services.fprot.updater.frequency
  • services.fprot.updater.licenseKeyfile
  • services.fprot.updater.productData
  • services.gale.setuidWrapper
  • services.gocd-agent.extraOptions
  • services.gocd-agent.startupOptions
  • services.gocd-server.extraGroups
  • services.gocd-server.extraOptions
  • services.gocd-server.startupOptions
  • services.gogoclient.server
  • services.gogoclient.username
  • services.gvpe.configFile
  • services.gvpe.configText
  • services.gvpe.customIFSetup
  • services.gvpe.ipAddress
  • services.gvpe.nodename
  • services.gvpe.subnet
  • services.hadoop.coreSite
  • services.hadoop.hdfsSite
  • services.hadoop.mapredSite
  • services.hadoop.yarnSite
  • services.heyefi.cardMacaddress
  • services.heyefi.uploadDir
  • services.heyefi.uploadKey
  • services.heyefi.user
  • services.hoogle.haskellPackages
  • services.hoogle.packages
  • services.hostapd.interface
  • services.ihaskell.extraPackages
  • services.ircdHybrid.adminEmail
  • services.ircdHybrid.certificate
  • services.ircdHybrid.description
  • services.ircdHybrid.extraIPs
  • services.ircdHybrid.extraPort
  • services.ircdHybrid.rsaKey
  • services.ircdHybrid.serverName
  • services.ircdHybrid.sid
  • services.jboss.deployDir
  • services.jboss.libUrl
  • services.jboss.logDir
  • services.jboss.serverDir
  • services.jboss.tempDir
  • services.jboss.user
  • services.k3s.extraFlags
  • services.lshd.hostKey
  • services.lshd.interfaces
  • services.lshd.loginShell
  • services.lshd.portNumber
  • services.lshd.srpKeyExchange
  • services.lshd.subsystems
  • services.mailpile.hostname
  • services.mailpile.port
  • services.mediatomb.group
  • services.mediatomb.interface
  • services.mediatomb.port
  • services.mediatomb.user
  • services.mediatomb.uuid
  • services.mediawiki.name
  • services.memcached.extraOptions
  • services.memcached.listen
  • services.memcached.maxConnections
  • services.memcached.maxMemory
  • services.memcached.port
  • services.memcached.user
  • services.mongodb.bind_ip
  • services.mongodb.dbpath
  • services.mongodb.extraConfig
  • services.mongodb.pidFile
  • services.mongodb.quiet
  • services.mongodb.replSetName
  • services.mongodb.user
  • services.mysqlBackup.databases
  • services.mysqlBackup.location
  • services.mysqlBackup.singleTransaction
  • services.mysqlBackup.user
  • services.netatalk.homes.basedirRegex
  • services.netatalk.homes.path
  • services.netatalk.port
  • services.netdata.python.extraPackages
  • services.nginx.config
  • services.nginx.logError
  • services.nsd.zones..children
  • services.ntp.servers
  • services.oauth2_proxy.extraConfig
  • services.octoprint.plugins
  • services.openafsServer.advertisedAddresses
  • services.postfix.dnsBlacklistOverrides
  • services.postfix.transport
  • services.postgresqlBackup.databases
  • services.postgresqlBackup.location
  • services.postgresqlBackup.startAt
  • services.prayer.port
  • services.quassel.dataDir
  • services.quassel.interfaces
  • services.quassel.portNumber
  • services.quassel.user
  • services.radvd.config
  • services.redis.masterAuth
  • services.redis.slaveOf
  • services.resilio.sharedFolders
  • services.rippled.extraConfig
  • services.rsyncd.address
  • services.sabnzbd.configFile
  • services.sabnzbd.group
  • services.sabnzbd.user
  • services.shairport-sync.arguments
  • services.shairport-sync.user
  • services.supybot.extraPackages
  • services.svnserve.svnBaseDir
  • services.synergy.client.screenName
  • services.synergy.client.serverAddress
  • services.synergy.server.address
  • services.synergy.server.configFile
  • services.synergy.server.screenName
  • services.timesyncd.servers
  • services.tomcat.extraGroups
  • services.unit.logDir
  • services.unit.stateDir
  • services.venus.feeds
  • services.virtuoso.config
  • services.virtuoso.dirsAllowed
  • services.virtuoso.httpListenAddress
  • services.virtuoso.listenAddress
  • services.virtuoso.parameters
  • services.vsftpd.userlist
  • services.wakeonlan.interfaces
  • services.weechat.binary
  • services.xserver.desktopManager.gnome3.sessionPath
  • services.xserver.desktopManager.pantheon.sessionPath
  • services.xserver.displayManager.lightdm.greeters.gtk.cursorTheme.package
  • services.xserver.displayManager.session
  • services.xserver.serverFlagsSection
  • services.xserver.useXFS
  • services.xserver.windowManager.exwm.extraPackages
  • services.xserver.windowManager.xmonad.extraPackages
  • services.xserver.windowManager.xmonad.haskellPackages
  • services.xtreemfs.dir.address
  • services.xtreemfs.dir.httpPort
  • services.xtreemfs.dir.port
  • services.xtreemfs.dir.syncMode
  • services.xtreemfs.dir.uuid
  • services.xtreemfs.homeDir
  • services.xtreemfs.mrc.address
  • services.xtreemfs.mrc.httpPort
  • services.xtreemfs.mrc.port
  • services.xtreemfs.mrc.syncMode
  • services.xtreemfs.mrc.uuid
  • services.xtreemfs.osd.address
  • services.xtreemfs.osd.httpPort
  • services.xtreemfs.osd.port
  • services.xtreemfs.osd.uuid
  • services.yandex-disk.directory
  • services.yandex-disk.user
  • specialisation..configuration
  • users.ldap.base
  • users.ldap.server
  • virtualisation.xen.bootParams
  • virtualisation.xen.bridge.name
  • virtualisation.xen.domain0MemorySize

That's good progress but it's not all done.

@bbjubjub2494
Copy link
Member

Related: #91813

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 25, 2020
@dasJ dasJ closed this as completed Nov 21, 2020
@xaverdh
Copy link
Contributor

xaverdh commented Nov 23, 2020

was this closed intentionally or by accident?

@dasJ
Copy link
Member Author

dasJ commented Jan 19, 2021

Thanks to some newfound motivation for this issue (and procrastination from my regular work 👀) 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

@stale
Copy link

stale bot commented Aug 5, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 5, 2021
@infinisil
Copy link
Member

Still relevant, and my #132448 should help with this

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 5, 2021
@Scriptkiddi
Copy link
Contributor

@dasJ could you regenerate the list? some things are out of date

@dasJ
Copy link
Member Author

dasJ commented Oct 15, 2021

Done

dasJ added a commit to helsinki-systems/nixpkgs that referenced this issue Oct 15, 2021
infinisil added a commit to infinisil/nixpkgs that referenced this issue Nov 30, 2021
This is a follow-up to NixOS#76184

Co-Authored-By: Silvan Mosberger <[email protected]>
dasJ added a commit to helsinki-systems/nixpkgs that referenced this issue Dec 10, 2021
This is a follow-up to NixOS#76184

Co-Authored-By: Silvan Mosberger <[email protected]>
infinisil added a commit to infinisil/nixpkgs that referenced this issue Feb 28, 2022
Makes all options rendered in the manual throw an error if they don't
have a type specified.

This is a follow-up to NixOS#76184

Co-Authored-By: Silvan Mosberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS
Projects
None yet
8 participants