mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-11-19 15:14:56 +01:00
Option aliases/deprecations can now be declared in any NixOS module,
not just in nixos/modules/rename.nix. This is more modular (since it
allows for example grub-related aliases to be declared in the grub
module), and allows aliases outside of NixOS (e.g. in NixOps modules).
The syntax is a bit funky. Ideally we'd have something like:
options = {
foo.bar.newOption = mkOption { ... };
foo.bar.oldOption = mkAliasOption [ "foo" "bar" "newOption" ];
};
but that's not possible because options cannot define values in
*other* options - you need to have a "config" for that. So instead we
have functions that return a *module*: mkRemovedOptionModule,
mkRenamedOptionModule and mkAliasOptionModule. These can be used via
"imports", e.g.
imports = [
(mkAliasOptionModule [ "foo" "bar" "oldOption" ] [ "foo" "bar" "newOption" ]);
];
As an added bonus, deprecation warnings now show the file name of the
offending module.
Fixes #10385.
|
||
|---|---|---|
| .. | ||
| loader | ||
| coredump.nix | ||
| emergency-mode.nix | ||
| kernel.nix | ||
| kexec.nix | ||
| luksroot.nix | ||
| modprobe.nix | ||
| networkd.nix | ||
| pbkdf2-sha512.c | ||
| readonly-mountpoint.c | ||
| resolved.nix | ||
| shutdown.nix | ||
| stage-1-init.sh | ||
| stage-1.nix | ||
| stage-2-init.sh | ||
| stage-2.nix | ||
| systemd-lib.nix | ||
| systemd-unit-options.nix | ||
| systemd.nix | ||
| timesyncd.nix | ||
| tmp.nix | ||