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

Create config builder to handle default config values #43672

Closed
wants to merge 1 commit into from

Conversation

matthewbauer
Copy link
Member

@matthewbauer matthewbauer commented Jul 17, 2018

Motivation for this change

This is spun off from #39580. This just adds a config.nix file to handle common config values already in Nixpkgs. We can reuse the mkOption function from NixOS module system.

@grahamc
Copy link
Member

grahamc commented Jul 17, 2018

Conceptually I like this a lot.

  1. I think I'd prefer envVar not be added to mkOption, to make it harder to use in NixOS. what do you and others think?
  2. will this break if I add arbitrary other stuff to my configuration?

@grahamc
Copy link
Member

grahamc commented Jul 18, 2018

@GrahamcOfBorg eval

pkgs/top-level/config.nix provides some defaults for the config values.
This allows global defaults to be provided for config options &
prevents individual packages for having to interpret the defaults.
Hopefully this will make way for better documentation of configuration
options. Eventually I want to move this into a proper module system,
see (NixOS#39580).

Other squashed commits:

- check-meta: use default values from pkgs/top-level/config.nix

  We no longer have to check that these exist - their defaults are
  configured there.

- config: propagate original config

  Lots of times we will have custom config options. We want these to
  still be accessible in Nixpkgs.

- config: add packageOverrides

  One config option I originally missed.

- config: fix licenses loop

  blacklistedLicenses & whitelistedLicense cannot depend on each other
  in their apply function. Instead just use the original config’.

- treewide: remove ‘or’ default for configs

  these are now provided by config.nix

- config: make types enforced

config.shouldCheckMeta -> config.checkMeta

This was the original name.
@dtzWill
Copy link
Member

dtzWill commented Aug 8, 2018

!!! Great, ty!

@Ericson2314
Copy link
Member

N.B. #16531 tried it before. I think my views might have softened since then :).

@matthewbauer
Copy link
Member Author

Closing for now. If someone wants to take this up, feel free...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: nixos 6.topic: python 6.topic: stdenv Standard environment 6.topic: vim 6.topic: xfce The Xfce Desktop Environment 8.has: module (update)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants