1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs synced 2024-10-19 03:47:13 -04:00
nixpkgs/lib
Eelco Dolstra 5f077e2296 Factor out option renaming
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.
2015-10-14 18:18:47 +02:00
..
tests
attrsets.nix Add lib.filterAttrsRecursive function 2015-09-19 00:33:44 +02:00
composable-derivation.nix
customisation.nix lib: add makeScope 2015-09-27 09:45:23 -05:00
debug.nix
default.nix
deprecated.nix
licenses.nix lib.licenses: add fdl13 2015-09-27 09:45:35 -05:00
lists.nix
maintainers.nix git-crypt: update maintainer 2015-10-14 21:46:27 +08:00
meta.nix
modules.nix Factor out option renaming 2015-10-14 18:18:47 +02:00
options.nix
platforms.nix
sources.nix
strings-with-deps.nix
strings.nix
systems.nix
tests.nix
trivial.nix
types.nix nixos,lib: move environment generation related copy-paste to lib 2015-09-18 18:48:49 +00:00