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

[backport 24.11] treewide: remove deprecations up until 24.11 #358798

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions doc/build-helpers/trivial-build-helpers.chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -754,10 +754,6 @@ This creates a derivation with a directory structure like the following:
...
```

## `writeReferencesToFile` {#trivial-builder-writeReferencesToFile}

Deprecated. Use [`writeClosure`](#trivial-builder-writeClosure) instead.

## `writeClosure` {#trivial-builder-writeClosure}

Given a list of [store paths](https://nixos.org/manual/nix/stable/glossary#gloss-store-path) (or string-like expressions coercible to store paths), write their collective [closure](https://nixos.org/manual/nix/stable/glossary#gloss-closure) to a text file.
Expand Down
2 changes: 1 addition & 1 deletion lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ let
scrubOptionValue literalExpression literalExample
showOption showOptionWithDefLocs showFiles
unknownModule mkOption mkPackageOption mkPackageOptionMD
mdDoc literalMD;
literalMD;
inherit (self.types) isType setType defaultTypeMerge defaultFunctor
isOptionType mkOptionType;
inherit (self.asserts)
Expand Down
7 changes: 0 additions & 7 deletions lib/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -399,13 +399,6 @@ rec {

literalExample = lib.warn "lib.literalExample is deprecated, use lib.literalExpression instead, or use lib.literalMD for a non-Nix description." literalExpression;

/* Transition marker for documentation that's already migrated to markdown
syntax. Has been a no-op for some while and been removed from nixpkgs.
Kept here to alert downstream users who may not be aware of the migration's
completion that it should be removed from modules.
*/
mdDoc = lib.warn "lib.mdDoc will be removed from nixpkgs in 24.11. Option descriptions are now in Markdown by default; you can remove any remaining uses of lib.mdDoc.";

/* For use in the `defaultText` and `example` option attributes. Causes the
given MD text to be inserted verbatim in the documentation, for when
a `literalExpression` would be too hard to read.
Expand Down
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2411.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,8 @@

- The `shadowstack` hardening flag has been added, though disabled by default.

- `writeReferencesToFile` has been removed after its deprecation in 24.05. Use the trivial build helper `writeClosure` instead.

- `xxd` is now provided by the `tinyxxd` package rather than `vim.xxd` to reduce closure size and vulnerability impact. Since it has the same options and semantics as Vim's `xxd` utility, there is no user impact. Vim's `xxd` remains available as the `vim.xxd` package.

- `restic` module now has an option for inhibiting system sleep while backups are running, defaulting to off (not inhibiting sleep). Available as [`services.restic.backups.<name>.inhibitsSleep`](#opt-services.restic.backups._name_.inhibitsSleep).
Expand Down
16 changes: 0 additions & 16 deletions nixos/lib/make-options-doc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@
}
```

## optionsDocBook

deprecated since 23.11 and will be removed in 24.05.

## optionsAsciiDoc

Documentation rendered as AsciiDoc. This is useful for e.g. man pages.
Expand Down Expand Up @@ -111,18 +107,8 @@
# instead of printing warnings for eg options with missing descriptions (which may be lost
# by nix build unless -L is given), emit errors instead and fail the build
, warningsAreErrors ? true
# allow docbook option docs if `true`. only markdown documentation is allowed when set to
# `false`, and a different renderer may be used with different bugs and performance
# characteristics but (hopefully) indistinguishable output.
# deprecated since 23.11.
# TODO remove in a while.
, allowDocBook ? false
# TODO remove in a while (see https://github.com/NixOS/nixpkgs/issues/300735)
, markdownByDefault ? true
}:

assert markdownByDefault && ! allowDocBook;

let
rawOpts = lib.optionAttrSetToDocList options;
transformedOpts = map transformOptions rawOpts;
Expand Down Expand Up @@ -229,6 +215,4 @@ in rec {
echo "file json $dst/options.json" >> $out/nix-support/hydra-build-products
echo "file json-br $dst/options.json.br" >> $out/nix-support/hydra-build-products
'';

optionsDocBook = throw "optionsDocBook has been removed in 24.05";
}
9 changes: 0 additions & 9 deletions nixos/modules/programs/screen.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ in
};

config = lib.mkMerge [
{
# TODO: Added in 24.05, remove before 24.11
assertions = [
{
assertion = cfg.screenrc != "" -> cfg.enable;
message = "`programs.screen.screenrc` has been configured, but `programs.screen.enable` is not true";
}
];
}
(lib.mkIf cfg.enable {
environment.etc.screenrc = {
text = cfg.screenrc;
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/desktops/pipewire/pipewire.nix
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ in {
)
config.environment.etc
)) == 1;
message = "Using `environment.etc.\"pipewire<...>\"` directly is no longer supported in 24.05. Use `services.pipewire.extraConfig` or `services.pipewire.configPackages` instead.";
message = "Using `environment.etc.\"pipewire<...>\"` directly is no longer supported. Use `services.pipewire.extraConfig` or `services.pipewire.configPackages` instead.";
}
];

Expand Down
3 changes: 0 additions & 3 deletions nixos/modules/services/games/archisteamfarm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ in
};

config = lib.mkIf cfg.enable {
# TODO: drop with 24.11
services.archisteamfarm.dataDir = lib.mkIf (lib.versionAtLeast config.system.stateVersion "24.05") (lib.mkDefault "/var/lib/asf");

users = {
users.archisteamfarm = {
home = cfg.dataDir;
Expand Down
3 changes: 1 addition & 2 deletions nixos/modules/services/home-automation/zigbee2mqtt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ in
meta.maintainers = with lib.maintainers; [ sweber hexa ];

imports = [
# Remove warning before the 21.11 release
(lib.mkRenamedOptionModule [ "services" "zigbee2mqtt" "config" ] [ "services" "zigbee2mqtt" "settings" ])
(lib.mkRemovedOptionModule [ "services" "zigbee2mqtt" "config" ] "The option services.zigbee2mqtt.config was renamed to services.zigbee2mqtt.settings.")
];

options.services.zigbee2mqtt = {
Expand Down
40 changes: 0 additions & 40 deletions nixos/modules/services/web-servers/garage.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,46 +93,6 @@ in
};

config = mkIf cfg.enable {

assertions = [
# We removed our module-level default for replication_mode. If a user upgraded
# to garage 1.0.0 while relying on the module-level default, they would be left
# with a config which evaluates and builds, but then garage refuses to start
# because either replication_factor or replication_mode is required.
# The replication_factor option also was `toString`'ed before, which is
# now not possible anymore, so we prompt the user to change it to a string
# if present.
# These assertions can be removed in NixOS 24.11, when all users have been
# warned once.
{
assertion =
(cfg.settings ? replication_factor || cfg.settings ? replication_mode)
|| lib.versionOlder cfg.package.version "1.0.0";
message = ''
Garage 1.0.0 requires an explicit replication factor to be set.
Please set replication_factor to 1 explicitly to preserve the previous behavior.
https://git.deuxfleurs.fr/Deuxfleurs/garage/src/tag/v1.0.0/doc/book/reference-manual/configuration.md#replication_factor

'';
}
{
assertion = lib.isString (cfg.settings.replication_mode or "");
message = ''
The explicit `replication_mode` option in `services.garage.settings`
has been removed and is now handled by the freeform settings in order
to allow it being completely absent (for Garage 1.x).
That module option previously `toString`'ed the value it's configured
with, which is now no longer possible.

You're still using a non-string here, please manually set it to
a string, or migrate to the separate setting keys introduced in 1.x.

Refer to https://garagehq.deuxfleurs.fr/documentation/working-documents/migration-1/
for the migration guide.
'';
}
];

environment.etc."garage.toml" = {
source = configFile;
};
Expand Down
30 changes: 0 additions & 30 deletions pkgs/applications/virtualization/singularity/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,6 @@ in
# inside the upstream source code.
# Include "/run/wrappers/bin" by default for the convenience of NixOS users.
systemBinPaths ? [ "/run/wrappers/bin" ],
# Path to SUID-ed newuidmap executable
# Deprecated in favour of systemBinPaths
# TODO(@ShamrockLee): Remove after Nixpkgs 24.05 branch-off
newuidmapPath ? null,
# Path to SUID-ed newgidmap executable
# Deprecated in favour of systemBinPaths
# TODO(@ShamrockLee): Remove after Nixpkgs 24.05 branch-off
newgidmapPath ? null,
# External LOCALSTATEDIR
externalLocalStateDir ? null,
# Remove the symlinks to `singularity*` when projectName != "singularity"
Expand All @@ -110,28 +102,6 @@ in
}@args:

let
# Backward compatibility for privileged-un-utils.
# TODO(@ShamrockLee): Remove after Nixpkgs 24.05 branch-off.
privileged-un-utils =
if ((newuidmapPath == null) && (newgidmapPath == null)) then
null
else
lib.warn
"${pname}: arguments newuidmapPath and newgidmapPath is deprecated in favour of systemBinPaths."
(
runCommandLocal "privileged-un-utils" { } ''
mkdir -p "$out/bin"
ln -s ${lib.escapeShellArg newuidmapPath} "$out/bin/newuidmap"
ln -s ${lib.escapeShellArg newgidmapPath} "$out/bin/newgidmap"
''
);

# Backward compatibility for privileged-un-utils.
# TODO(@ShamrockLee): Remove after Nixpkgs 24.05 branch-off.
systemBinPaths =
lib.optional (privileged-un-utils != null) (lib.makeBinPath [ privileged-un-utils ])
++ args.systemBinPaths or [ "/run/wrappers/bin" ];

concatMapStringAttrsSep =
sep: f: attrs:
lib.concatMapStringsSep sep (name: f name attrs.${name}) (lib.attrNames attrs);
Expand Down
16 changes: 3 additions & 13 deletions pkgs/build-support/trivial-builders/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,6 @@ rec {
# See https://nixos.org/manual/nixpkgs/unstable/#sec-pkgs.makeSetupHook
makeSetupHook =
{ name ? lib.warn "calling makeSetupHook without passing a name is deprecated." "hook"
, deps ? [ ]
# hooks go in nativeBuildInputs so these will be nativeBuildInputs
, propagatedBuildInputs ? [ ]
# these will be buildInputs
Expand All @@ -625,11 +624,7 @@ rec {
__structuredAttrs = false;
inherit meta;
inherit depsTargetTargetPropagated;
propagatedBuildInputs =
# remove list conditionals before 23.11
lib.warnIf (!lib.isList deps) "'deps' argument to makeSetupHook must be a list. content of deps: ${toString deps}"
(lib.warnIf (deps != [ ]) "'deps' argument to makeSetupHook is deprecated and will be removed in release 23.11., Please use propagatedBuildInputs instead. content of deps: ${toString deps}"
propagatedBuildInputs ++ (if lib.isList deps then deps else [ deps ]));
inherit propagatedBuildInputs;
strictDeps = true;
# TODO 2023-01, no backport: simplify to inherit passthru;
passthru = passthru
Expand All @@ -645,13 +640,8 @@ rec {
substituteAll ${script} $out/nix-support/setup-hook
'');


# Docs in doc/build-helpers/trivial-build-helpers.chapter.md
# See https://nixos.org/manual/nixpkgs/unstable/#trivial-builder-writeReferencesToFile
# TODO: Convert to throw after Nixpkgs 24.05 branch-off.
writeReferencesToFile = (if config.allowAliases then lib.warn else throw)
"writeReferencesToFile is deprecated in favour of writeClosure"
(path: writeClosure [ path ]);
# Remove after 25.05 branch-off
writeReferencesToFile = throw "writeReferencesToFile has been removed. Use writeClosure instead.";

# Docs in doc/build-helpers/trivial-build-helpers.chapter.md
# See https://nixos.org/manual/nixpkgs/unstable/#trivial-builder-writeClosure
Expand Down
3 changes: 0 additions & 3 deletions pkgs/by-name/la/lammps/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ stdenv.mkDerivation (finalAttrs: {
];

passthru = {
# Remove these at some point - perhaps after release 23.11. See discussion at:
# https://github.com/NixOS/nixpkgs/pull/238771#discussion_r1235459961
mpi = throw "`lammps-mpi.passthru.mpi` was removed in favor of `extraBuildInputs`";
inherit packages;
inherit extraCmakeFlags;
inherit extraBuildInputs;
Expand Down
3 changes: 0 additions & 3 deletions pkgs/by-name/re/redocly/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ buildNpmPackage rec {
$out/bin/redocly \
--set-default REDOCLY_TELEMETRY off \
--set-default REDOCLY_SUPPRESS_UPDATE_NOTICE true

# Symlink for backwards compatibility. Remove after 24.05.
ln -s $out/bin/redocly $out/bin/redocly-cli
'';

passthru = {
Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/libraries/qt-6/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,6 @@ let
};
} ./hooks/qmake-hook.sh)
{ };
} // lib.optionalAttrs config.allowAliases {
# Remove completely before 24.11
overrideScope' = builtins.throw "qt6 now uses makeScopeWithSplicing which does not have \"overrideScope'\", use \"overrideScope\".";
};

baseScope = makeScopeWithSplicing' {
Expand Down
39 changes: 1 addition & 38 deletions pkgs/pkgs-lib/formats/hocon/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -101,43 +101,6 @@ in
lib = hoconLib;

generate = name: value:
let
# TODO: remove in 24.11
# Backwards compatibility for generators in the following locations:
# - nixos/modules/services/networking/jibri/default.nix (__hocon_envvar)
# - nixos/modules/services/networking/jicofo.nix (__hocon_envvar, __hocon_unquoted_string)
# - nixos/modules/services/networking/jitsi-videobridge.nix (__hocon_envvar)
replaceOldIndicators = value:
if lib.isAttrs value then
(if value ? "__hocon_envvar"
then
lib.warn ''
Use of `__hocon_envvar` has been deprecated, and will
be removed in the future.

Please use `(pkgs.formats.hocon {}).lib.mkSubstitution` instead.
''
(hoconLib.mkSubstitution value.__hocon_envvar)
else if value ? "__hocon_unquoted_string"
then
lib.warn ''
Use of `__hocon_unquoted_string` has been deprecated, and will
be removed in the future.

Please make use of the freeform options of
`(pkgs.formats.hocon {}).format` instead.
''
{
value = value.__hocon_unquoted_string;
_type = "unquoted_string";
}
else lib.mapAttrs (_: replaceOldIndicators) value)
else if lib.isList value
then map replaceOldIndicators value
else value;

finalValue = replaceOldIndicators value;
in
callPackage
({
stdenvNoCC
Expand All @@ -151,7 +114,7 @@ in
dontUnpack = true;
preferLocalBuild = true;

json = builtins.toJSON finalValue;
json = builtins.toJSON value;
passAsFile = [ "json" ];

strictDeps = true;
Expand Down
Loading