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?

@GrahamcOfBorg GrahamcOfBorg added 6.topic: stdenv Standard environment 2.status: merge conflict This PR has merge conflicts with the target branch labels Jul 17, 2018
@grahamc
Copy link
Member

grahamc commented Jul 18, 2018

@GrahamcOfBorg eval

@GrahamcOfBorg GrahamcOfBorg removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 18, 2018
@matthewbauer matthewbauer requested a review from FRidh as a code owner July 19, 2018 00:48
@matthewbauer matthewbauer force-pushed the config-builder branch 2 times, most recently from 6e237d0 to b6e6b0d Compare July 21, 2018 21:54
@GrahamcOfBorg GrahamcOfBorg added 6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: vim 6.topic: xfce The Xfce Desktop Environment 8.has: module (update) This PR changes an existing module in `nixos/` labels Jul 21, 2018
@matthewbauer matthewbauer force-pushed the config-builder branch 3 times, most recently from e442579 to 7ac5390 Compare July 22, 2018 02:19
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 Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python 6.topic: stdenv Standard environment 6.topic: vim 6.topic: xfce The Xfce Desktop Environment 8.has: module (update) This PR changes an existing module in `nixos/`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants