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
This commit is contained in:
commit
eb8ce7930d
@ -1,11 +1,7 @@
|
||||
# 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)
|
||||
|
@ -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.
|
||||
|
@ -20,9 +20,6 @@ in
|
||||
{
|
||||
|
||||
config = mkIf enabled {
|
||||
|
||||
nixpkgs.config.xorg.abiCompat = "1.20";
|
||||
|
||||
services.xserver.drivers = singleton
|
||||
{ name = "amdgpu"; modules = [ package ]; display = true; };
|
||||
|
||||
|
@ -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; };
|
||||
|
||||
|
@ -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}
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -27,6 +27,6 @@ with lib;
|
||||
"opt/brave/native-messaging-hosts/${appId}".source = source "hosts/chromium";
|
||||
"opt/brave/policies/managed/${appId}".source = source "policies/chromium";
|
||||
};
|
||||
nixpkgs.config.firefox.enableBrowserpass = true;
|
||||
programs.firefox.wrapperConfig.enableBrowserpass = true;
|
||||
};
|
||||
}
|
||||
|
@ -36,6 +36,12 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
wrapperConfig = mkOption {
|
||||
type = types.attrs;
|
||||
default = {};
|
||||
description = mdDoc "Arguments to pass to Firefox wrapper";
|
||||
};
|
||||
|
||||
policies = mkOption {
|
||||
type = policyFormat.type;
|
||||
default = { };
|
||||
@ -227,16 +233,22 @@ in
|
||||
] ++ optionals nmh.passff [
|
||||
passff-host
|
||||
];
|
||||
})
|
||||
];
|
||||
cfg = let
|
||||
# copy-pasted from the wrapper; TODO: figure out fix
|
||||
applicationName = cfg.package.binaryName or (lib.getName cfg.package);
|
||||
|
||||
nixpkgs.config.firefox = {
|
||||
nixpkgsConfig = config.nixpkgs.config.${applicationName} or {};
|
||||
optionConfig = cfg.wrapperConfig;
|
||||
nmhConfig = {
|
||||
enableBrowserpass = nmh.browserpass;
|
||||
enableBukubrow = nmh.bukubrow;
|
||||
enableTridactylNative = nmh.tridactyl;
|
||||
enableUgetIntegrator = nmh.ugetIntegrator;
|
||||
enableFXCastBridge = nmh.fxCast;
|
||||
};
|
||||
in nixpkgsConfig // optionConfig // nmhConfig;
|
||||
})
|
||||
];
|
||||
|
||||
environment.etc =
|
||||
let
|
||||
|
@ -42,6 +42,6 @@ in
|
||||
|
||||
services.dbus.packages = [ pkgs.gnome-browser-connector ];
|
||||
|
||||
nixpkgs.config.firefox.enableGnomeExtensions = true;
|
||||
programs.firefox.wrapperConfig.enableGnomeExtensions = true;
|
||||
};
|
||||
}
|
||||
|
@ -282,9 +282,6 @@ in
|
||||
|
||||
# Override GSettings schemas
|
||||
environment.sessionVariables.NIX_GSETTINGS_OVERRIDES_DIR = "${nixos-gsettings-desktop-schemas}/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas";
|
||||
|
||||
# If gnome is installed, build vim for gtk3 too.
|
||||
nixpkgs.config.vim.gui = "gtk3";
|
||||
})
|
||||
|
||||
(mkIf flashbackEnabled {
|
||||
|
@ -379,7 +379,7 @@ in
|
||||
# Update the start menu for each user that is currently logged in
|
||||
system.userActivationScripts.plasmaSetup = activationScript;
|
||||
|
||||
nixpkgs.config.firefox.enablePlasmaBrowserIntegration = true;
|
||||
programs.firefox.wrapperConfig.enablePlasmaBrowserIntegration = true;
|
||||
})
|
||||
|
||||
(mkIf (cfg.kwinrc != {}) {
|
||||
|
@ -61,7 +61,7 @@ in
|
||||
|
||||
services.xserver.displayManager.lightdm.greeters.gtk.enable = false;
|
||||
|
||||
nixpkgs.config.lightdm-tiny-greeter.conf =
|
||||
services.xserver.displayManager.lightdm.greeter =
|
||||
let
|
||||
configHeader = ''
|
||||
#include <gtk/gtk.h>
|
||||
@ -69,13 +69,11 @@ in
|
||||
static const char *pass_text = "${cfg.label.pass}";
|
||||
static const char *session = "${dmcfg.defaultSession}";
|
||||
'';
|
||||
config = optionalString (cfg.extraConfig != "") (configHeader + cfg.extraConfig);
|
||||
package = pkgs.lightdm-tiny-greeter.override { conf = config; };
|
||||
in
|
||||
optionalString (cfg.extraConfig != "")
|
||||
(configHeader + cfg.extraConfig);
|
||||
|
||||
services.xserver.displayManager.lightdm.greeter =
|
||||
mkDefault {
|
||||
package = pkgs.lightdm-tiny-greeter.xgreeters;
|
||||
package = package.xgreeters;
|
||||
name = "lightdm-tiny-greeter";
|
||||
};
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
{ lib, stdenv, linkFarm, lightdm-tiny-greeter, fetchFromGitHub
|
||||
, pkg-config, lightdm, gtk3, glib, wrapGAppsHook, conf ? "" }:
|
||||
, pkg-config, lightdm, gtk3, glib, wrapGAppsHook, config, conf ? config.lightdm-tiny-greeter.conf or "" }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "lightdm-tiny-greeter";
|
||||
|
@ -1,5 +1,4 @@
|
||||
{ abiCompat ? null,
|
||||
callPackage,
|
||||
{ callPackage,
|
||||
lib, stdenv, makeWrapper, fetchurl, fetchpatch, fetchFromGitLab, buildPackages,
|
||||
automake, autoconf, libiconv, libtool, intltool, gettext, python3, perl,
|
||||
freetype, tradcpp, fontconfig, meson, ninja, ed, fontforge,
|
||||
@ -738,12 +737,8 @@ self: super:
|
||||
});
|
||||
|
||||
xorgserver = with xorg; super.xorgserver.overrideAttrs (attrs_passed:
|
||||
# exchange attrs if abiCompat is set
|
||||
let
|
||||
version = lib.getVersion attrs_passed;
|
||||
attrs =
|
||||
if (abiCompat == null || lib.hasPrefix abiCompat version) then
|
||||
attrs_passed // {
|
||||
attrs = attrs_passed // {
|
||||
buildInputs = attrs_passed.buildInputs ++
|
||||
lib.optional (libdrm != null) libdrm.dev;
|
||||
postPatch = ''
|
||||
@ -753,9 +748,7 @@ self: super:
|
||||
done
|
||||
'';
|
||||
meta = attrs_passed.meta // { mainProgram = "X"; };
|
||||
}
|
||||
else throw "unsupported xorg abiCompat ${abiCompat} for ${attrs_passed.name}";
|
||||
|
||||
};
|
||||
in attrs //
|
||||
(let
|
||||
version = lib.getVersion attrs;
|
||||
|
@ -1,8 +1,6 @@
|
||||
{ lib, stdenv, fetchurl, config }:
|
||||
{ lib, stdenv, fetchurl, config, dbfile ? config.locate.dbfile or "/var/cache/locatedb" }:
|
||||
|
||||
let
|
||||
dbfile = lib.attrByPath [ "locate" "dbfile" ] "/var/cache/locatedb" config;
|
||||
in stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mlocate";
|
||||
version = "0.26";
|
||||
|
||||
|
@ -8,10 +8,8 @@
|
||||
, systemd
|
||||
, liburing
|
||||
, zstd
|
||||
, dbfile ? config.locate.dbfile or "/var/cache/locatedb"
|
||||
}:
|
||||
let
|
||||
dbfile = lib.attrByPath [ "locate" "dbfile" ] "/var/cache/locatedb" config;
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "plocate";
|
||||
version = "1.1.19";
|
||||
|
@ -27666,7 +27666,6 @@ with pkgs;
|
||||
inherit (buildPackages.darwin) bootstrap_cmds;
|
||||
udev = if stdenv.isLinux then udev else null;
|
||||
libdrm = if stdenv.isLinux then libdrm else null;
|
||||
abiCompat = config.xorg.abiCompat or null; # `config` because we have no `xorg.override`
|
||||
};
|
||||
|
||||
generatedPackages = lib.callPackageWith __splicedPackages ../servers/x11/xorg/default.nix { };
|
||||
@ -35614,9 +35613,7 @@ with pkgs;
|
||||
|
||||
lightdm-mobile-greeter = callPackage ../applications/display-managers/lightdm-mobile-greeter { };
|
||||
|
||||
lightdm-tiny-greeter = callPackage ../applications/display-managers/lightdm-tiny-greeter {
|
||||
conf = config.lightdm-tiny-greeter.conf or "";
|
||||
};
|
||||
lightdm-tiny-greeter = callPackage ../applications/display-managers/lightdm-tiny-greeter { };
|
||||
|
||||
ly = callPackage ../applications/display-managers/ly { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user