Unverified Commit eb8ce793 authored by K900's avatar K900 Committed by GitHub
Browse files

Merge pull request #257458 from K900/die-nixpkgs-config-die

treewide: fail when `nixpkgs.config` is set with explicit `pkgs`, remove all `nixpkgs.config` usages in in-tree modules
parents 479a4134 95c3abfd
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
# Customising Packages {#sec-customising-packages}

Some packages in Nixpkgs have options to enable or disable optional
functionality or change other aspects of the package. For instance, the
Firefox wrapper package (which provides Firefox with a set of plugins
such as the Adobe Flash player) has an option to enable the Google Talk
plugin. It can be set in `configuration.nix` as follows:
`nixpkgs.config.firefox.enableGoogleTalkPlugin = true;`
functionality or change other aspects of the package.

::: {.warning}
Unfortunately, Nixpkgs currently lacks a way to query available
@@ -13,7 +9,7 @@ configuration options.
:::

::: {.note}
Alternatively, many packages come with extensions one might add.
For example, many packages come with extensions one might add.
Examples include:
- [`passExtensions.pass-otp`](https://search.nixos.org/packages/query=passExtensions.pass-otp)
- [`python310Packages.requests`](https://search.nixos.org/packages/query=python310Packages.requests)
+2 −0
Original line number Diff line number Diff line
@@ -257,6 +257,8 @@

- The `services.mtr-exporter.target` has been removed in favor of `services.mtr-exporter.jobs` which allows specifying multiple targets.

- Setting `nixpkgs.config` options while providing an external `pkgs` instance will now raise an error instead of silently ignoring the options. NixOS modules no longer set `nixpkgs.config` to accomodate this. This specifically affects `services.locate`, `services.xserver.displayManager.lightdm.greeters.tiny` and `programs.firefox` NixOS modules. No manual intervention should be required in most cases, however, configurations relying on those modules affecting packages outside the system environment should switch to explicit overlays.

## Other Notable Changes {#sec-release-23.11-notable-changes}

- The Cinnamon module now enables XDG desktop integration by default. If you are experiencing collisions related to xdg-desktop-portal-gtk you can safely remove `xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];` from your NixOS configuration.
+0 −3
Original line number Diff line number Diff line
@@ -20,9 +20,6 @@ in
{

  config = mkIf enabled {

    nixpkgs.config.xorg.abiCompat = "1.20";

    services.xserver.drivers = singleton
      { name = "amdgpu"; modules = [ package ]; display = true; };

+1 −3
Original line number Diff line number Diff line
@@ -230,9 +230,7 @@ in
        plocate = (mkIf isPLocate (mkMerge [ common plocate ]));
      };

    nixpkgs.config = { locate.dbfile = cfg.output; };

    environment.systemPackages = [ cfg.locate ];
    environment.systemPackages = [ (cfg.locate.override { dbfile = cfg.output; }) ];

    environment.variables = mkIf (!isMorPLocate) { LOCATE_PATH = cfg.output; };

+10 −0
Original line number Diff line number Diff line
@@ -379,6 +379,16 @@ in
          the legacy definitions.
        '';
      }
      {
        assertion = opt.pkgs.isDefined -> cfg.config == {};
        message = ''
          Your system configures nixpkgs with an externally created instance.
          `nixpkgs.config` options should be passed when creating the instance instead.

          Current value:
          ${lib.generators.toPretty { multiline = true; } opt.config}
        '';
      }
    ];
  };

Loading