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 NixOS modules: Add error context on module arguments evaluation. 2015-07-14 15:07:54 +02:00
attrsets.nix Add lib.filterAttrsRecursive function 2015-09-19 00:33:44 +02:00
composable-derivation.nix Shea told me composableDerivation is hard to understand. 2014-04-30 20:31:40 +02:00
customisation.nix lib: add makeScope 2015-09-27 09:45:23 -05:00
debug.nix lib: cleanup a little bit, add traceIf 2015-03-26 12:43:42 +00:00
default.nix Rename misc.nix -> deprecated.nix 2015-07-23 18:31:54 +02:00
deprecated.nix Remove deepOverride 2015-07-28 21:42:25 +02:00
licenses.nix lib.licenses: add fdl13 2015-09-27 09:45:35 -05:00
lists.nix Use builtins.sort 2015-07-28 18:42:22 +02:00
maintainers.nix git-crypt: update maintainer 2015-10-14 21:46:27 +08:00
meta.nix Make appendToName do the right thing 2014-03-10 15:01:56 +01:00
modules.nix Factor out option renaming 2015-10-14 18:18:47 +02:00
options.nix Add read-only options 2015-07-30 13:44:50 +02:00
platforms.nix Improve the list of archs made by commit 1299c020e9db3 2015-04-17 15:25:54 +02:00
sources.nix Manual: Handle XML files in subdirectories 2014-08-25 14:33:33 +02:00
strings-with-deps.nix Replace hasAttr/getAttr calls with the ? and . operators 2014-10-05 01:11:06 +02:00
strings.nix Allow options with type "package" to be store paths 2015-08-07 03:09:57 +02:00
systems.nix lib: Use arithmetic operators rather than builtins.add etc. 2014-10-05 01:10:06 +02:00
tests.nix
trivial.nix Rename misc.nix -> deprecated.nix 2015-07-23 18:31:54 +02:00
types.nix nixos,lib: move environment generation related copy-paste to lib 2015-09-18 18:48:49 +00:00