2014-04-14 16:26:48 +02:00
|
|
|
{ config, lib, options, ... }:
|
2013-10-23 17:50:55 +02:00
|
|
|
|
2014-04-14 16:26:48 +02:00
|
|
|
with lib;
|
2009-09-28 20:26:13 +02:00
|
|
|
|
|
|
|
let
|
2009-09-29 17:21:36 +02:00
|
|
|
|
2013-10-23 18:51:55 +02:00
|
|
|
alias = from: to: rename {
|
|
|
|
inherit from to;
|
2009-09-29 17:21:36 +02:00
|
|
|
name = "Alias";
|
2013-10-23 18:51:55 +02:00
|
|
|
use = id;
|
|
|
|
define = id;
|
2013-10-23 18:58:05 +02:00
|
|
|
visible = true;
|
2009-09-29 17:21:36 +02:00
|
|
|
};
|
|
|
|
|
2014-02-04 16:32:50 +01:00
|
|
|
# warn option was renamed
|
2013-10-23 18:51:55 +02:00
|
|
|
obsolete = from: to: rename {
|
|
|
|
inherit from to;
|
2009-09-29 17:21:36 +02:00
|
|
|
name = "Obsolete name";
|
2014-02-04 16:32:50 +01:00
|
|
|
use = x: builtins.trace "Obsolete option `${showOption from}' is used. It was renamed to `${showOption to}'." x;
|
2014-04-18 14:59:59 +02:00
|
|
|
define = x: builtins.trace "Obsolete option `${showOption from}' is used. It was renamed to `${showOption to}'." x;
|
2009-09-29 17:21:36 +02:00
|
|
|
};
|
|
|
|
|
2014-02-04 16:32:50 +01:00
|
|
|
# abort if deprecated option is used
|
2013-10-23 18:51:55 +02:00
|
|
|
deprecated = from: to: rename {
|
|
|
|
inherit from to;
|
2009-09-29 17:21:36 +02:00
|
|
|
name = "Deprecated name";
|
2014-02-04 16:32:50 +01:00
|
|
|
use = x: abort "Deprecated option `${showOption from}' is used. It was renamed to `${showOption to}'.";
|
2014-04-18 14:59:59 +02:00
|
|
|
define = x: abort "Deprecated option `${showOption from}' is used. It was renamed to `${showOption to}'.";
|
2009-09-29 17:21:36 +02:00
|
|
|
};
|
|
|
|
|
2013-10-23 18:58:05 +02:00
|
|
|
showOption = concatStringsSep ".";
|
2013-10-23 18:51:55 +02:00
|
|
|
|
2013-10-23 17:50:55 +02:00
|
|
|
zipModules = list:
|
2013-08-22 08:35:36 +02:00
|
|
|
zipAttrsWith (n: v:
|
2010-10-14 20:18:38 +02:00
|
|
|
if tail v != [] then
|
2015-01-22 14:02:47 +01:00
|
|
|
if all (o: isAttrs o && o ? _type) v then mkMerge v
|
|
|
|
else if n == "_type" then head v
|
2013-10-23 18:22:26 +02:00
|
|
|
else if n == "warnings" then concatLists v
|
2010-10-14 20:18:38 +02:00
|
|
|
else if n == "description" || n == "apply" then
|
|
|
|
abort "Cannot rename an option to multiple options."
|
|
|
|
else zipModules v
|
|
|
|
else head v
|
2009-09-28 20:26:13 +02:00
|
|
|
) list;
|
|
|
|
|
2013-10-23 18:58:05 +02:00
|
|
|
rename = { from, to, name, use, define, visible ? false }:
|
2009-09-28 20:26:13 +02:00
|
|
|
let
|
2013-10-23 18:51:55 +02:00
|
|
|
setTo = setAttrByPath to;
|
|
|
|
setFrom = setAttrByPath from;
|
|
|
|
toOf = attrByPath to
|
2013-10-23 18:58:05 +02:00
|
|
|
(abort "Renaming error: option `${showOption to}' does not exists.");
|
2013-10-23 18:51:55 +02:00
|
|
|
fromOf = attrByPath from
|
2013-10-23 18:58:05 +02:00
|
|
|
(abort "Internal error: option `${showOption from}' should be declared.");
|
2009-09-28 20:26:13 +02:00
|
|
|
in
|
2013-10-23 17:50:55 +02:00
|
|
|
[ { options = setFrom (mkOption {
|
2013-10-23 18:58:05 +02:00
|
|
|
description = "${name} of <option>${showOption to}</option>.";
|
2013-10-23 18:51:55 +02:00
|
|
|
apply = x: use (toOf config);
|
2013-10-23 18:58:05 +02:00
|
|
|
inherit visible;
|
2013-10-23 17:50:55 +02:00
|
|
|
});
|
2014-12-22 22:38:38 +01:00
|
|
|
|
|
|
|
config = setTo (mkAliasAndWrapDefinitions define (fromOf options));
|
2013-10-23 17:50:55 +02:00
|
|
|
}
|
|
|
|
];
|
2009-09-28 20:26:13 +02:00
|
|
|
|
2013-10-23 18:51:55 +02:00
|
|
|
obsolete' = option: singleton
|
|
|
|
{ options = setAttrByPath option (mkOption {
|
2013-10-23 18:22:26 +02:00
|
|
|
default = null;
|
|
|
|
visible = false;
|
|
|
|
});
|
2013-10-23 18:51:55 +02:00
|
|
|
config.warnings = optional (getAttrFromPath option config != null)
|
2013-10-23 18:58:05 +02:00
|
|
|
"The option `${showOption option}' defined in your configuration no longer has any effect; please remove it.";
|
2013-10-23 18:22:26 +02:00
|
|
|
};
|
|
|
|
|
2009-09-28 20:26:13 +02:00
|
|
|
in zipModules ([]
|
|
|
|
|
2013-10-30 17:52:35 +01:00
|
|
|
++ obsolete [ "environment" "x11Packages" ] [ "environment" "systemPackages" ]
|
2013-10-23 18:51:55 +02:00
|
|
|
++ obsolete [ "environment" "enableBashCompletion" ] [ "programs" "bash" "enableCompletion" ]
|
2013-10-28 16:28:04 +01:00
|
|
|
++ obsolete [ "environment" "nix" ] [ "nix" "package" ]
|
2014-11-30 20:36:49 +01:00
|
|
|
++ obsolete [ "fonts" "enableFontConfig" ] [ "fonts" "fontconfig" "enable" ]
|
2014-04-29 12:25:47 +02:00
|
|
|
++ obsolete [ "fonts" "extraFonts" ] [ "fonts" "fonts" ]
|
2009-09-28 20:26:13 +02:00
|
|
|
|
2013-10-23 18:51:55 +02:00
|
|
|
++ obsolete [ "security" "extraSetuidPrograms" ] [ "security" "setuidPrograms" ]
|
|
|
|
++ obsolete [ "networking" "enableWLAN" ] [ "networking" "wireless" "enable" ]
|
|
|
|
++ obsolete [ "networking" "enableRT73Firmware" ] [ "networking" "enableRalinkFirmware" ]
|
2012-03-01 21:10:46 +01:00
|
|
|
|
2013-01-16 12:33:18 +01:00
|
|
|
# FIXME: Remove these eventually.
|
2013-10-23 18:51:55 +02:00
|
|
|
++ obsolete [ "boot" "systemd" "sockets" ] [ "systemd" "sockets" ]
|
|
|
|
++ obsolete [ "boot" "systemd" "targets" ] [ "systemd" "targets" ]
|
|
|
|
++ obsolete [ "boot" "systemd" "services" ] [ "systemd" "services" ]
|
2013-01-16 12:33:18 +01:00
|
|
|
|
2009-09-29 11:50:38 +02:00
|
|
|
# Old Grub-related options.
|
2013-10-23 18:51:55 +02:00
|
|
|
++ obsolete [ "boot" "copyKernels" ] [ "boot" "loader" "grub" "copyKernels" ]
|
|
|
|
++ obsolete [ "boot" "extraGrubEntries" ] [ "boot" "loader" "grub" "extraEntries" ]
|
|
|
|
++ obsolete [ "boot" "extraGrubEntriesBeforeNixos" ] [ "boot" "loader" "grub" "extraEntriesBeforeNixOS" ]
|
|
|
|
++ obsolete [ "boot" "grubDevice" ] [ "boot" "loader" "grub" "device" ]
|
|
|
|
++ obsolete [ "boot" "bootMount" ] [ "boot" "loader" "grub" "bootDevice" ]
|
|
|
|
++ obsolete [ "boot" "grubSplashImage" ] [ "boot" "loader" "grub" "splashImage" ]
|
2009-09-28 20:26:13 +02:00
|
|
|
|
2013-10-23 18:51:55 +02:00
|
|
|
++ obsolete [ "boot" "initrd" "extraKernelModules" ] [ "boot" "initrd" "kernelModules" ]
|
2013-10-30 17:37:45 +01:00
|
|
|
++ obsolete [ "boot" "extraKernelParams" ] [ "boot" "kernelParams" ]
|
2009-12-15 15:05:01 +01:00
|
|
|
|
2010-03-11 18:02:49 +01:00
|
|
|
# OpenSSH
|
2013-10-23 18:51:55 +02:00
|
|
|
++ obsolete [ "services" "sshd" "ports" ] [ "services" "openssh" "ports" ]
|
|
|
|
++ alias [ "services" "sshd" "enable" ] [ "services" "openssh" "enable" ]
|
|
|
|
++ obsolete [ "services" "sshd" "allowSFTP" ] [ "services" "openssh" "allowSFTP" ]
|
|
|
|
++ obsolete [ "services" "sshd" "forwardX11" ] [ "services" "openssh" "forwardX11" ]
|
|
|
|
++ obsolete [ "services" "sshd" "gatewayPorts" ] [ "services" "openssh" "gatewayPorts" ]
|
|
|
|
++ obsolete [ "services" "sshd" "permitRootLogin" ] [ "services" "openssh" "permitRootLogin" ]
|
|
|
|
++ obsolete [ "services" "xserver" "startSSHAgent" ] [ "services" "xserver" "startOpenSSHAgent" ]
|
2014-04-18 00:45:26 +02:00
|
|
|
++ obsolete [ "services" "xserver" "startOpenSSHAgent" ] [ "programs" "ssh" "startAgent" ]
|
2009-11-22 01:40:53 +01:00
|
|
|
|
2014-11-27 18:07:54 +01:00
|
|
|
# VirtualBox
|
|
|
|
++ obsolete [ "services" "virtualbox" "enable" ] [ "services" "virtualboxGuest" "enable" ]
|
|
|
|
|
2015-03-10 08:40:08 +01:00
|
|
|
# Tarsnap
|
|
|
|
++ obsolete [ "services" "tarsnap" "config" ] [ "services" "tarsnap" "archives" ]
|
|
|
|
|
2014-11-19 20:13:54 +01:00
|
|
|
# proxy
|
|
|
|
++ obsolete [ "nix" "proxy" ] [ "networking" "proxy" "default" ]
|
|
|
|
|
2009-10-12 19:09:38 +02:00
|
|
|
# KDE
|
2015-01-22 14:02:47 +01:00
|
|
|
++ deprecated [ "kde" "extraPackages" ] [ "environment" "systemPackages" ]
|
|
|
|
++ obsolete [ "environment" "kdePackages" ] [ "environment" "systemPackages" ]
|
2009-10-06 21:25:25 +02:00
|
|
|
|
2013-02-02 06:03:45 +01:00
|
|
|
# Multiple efi bootloaders now
|
2013-10-23 18:51:55 +02:00
|
|
|
++ obsolete [ "boot" "loader" "efi" "efibootmgr" "enable" ] [ "boot" "loader" "efi" "canTouchEfiVariables" ]
|
2013-02-02 06:03:45 +01:00
|
|
|
|
2013-09-24 15:53:47 +02:00
|
|
|
# NixOS environment changes
|
|
|
|
# !!! this hardcodes bash, could we detect from config which shell is actually used?
|
2013-10-23 18:51:55 +02:00
|
|
|
++ obsolete [ "environment" "promptInit" ] [ "programs" "bash" "promptInit" ]
|
2013-09-24 15:53:47 +02:00
|
|
|
|
2014-03-03 13:55:50 +01:00
|
|
|
++ obsolete [ "services" "xserver" "driSupport" ] [ "hardware" "opengl" "driSupport" ]
|
|
|
|
++ obsolete [ "services" "xserver" "driSupport32Bit" ] [ "hardware" "opengl" "driSupport32Bit" ]
|
|
|
|
++ obsolete [ "services" "xserver" "s3tcSupport" ] [ "hardware" "opengl" "s3tcSupport" ]
|
2014-04-29 12:58:54 +02:00
|
|
|
++ obsolete [ "hardware" "opengl" "videoDrivers" ] [ "services" "xserver" "videoDrivers" ]
|
2014-01-15 14:08:45 +01:00
|
|
|
|
2014-02-26 13:54:04 +01:00
|
|
|
++ obsolete [ "services" "mysql55" ] [ "services" "mysql" ]
|
|
|
|
|
2015-04-10 16:11:07 +02:00
|
|
|
++ alias [ "environment" "checkConfigurationOptions" ] [ "_module" "check" ]
|
2014-05-05 22:23:57 +02:00
|
|
|
|
2015-03-29 14:50:12 +02:00
|
|
|
# XBMC
|
|
|
|
++ obsolete [ "services" "xserver" "windowManager" "xbmc" ] [ "services" "xserver" "desktopManager" "kodi" ]
|
|
|
|
++ obsolete [ "services" "xserver" "desktopManager" "xbmc" ] [ "services" "xserver" "desktopManager" "kodi" ]
|
|
|
|
|
2013-10-23 18:22:26 +02:00
|
|
|
# Options that are obsolete and have no replacement.
|
2013-10-23 18:51:55 +02:00
|
|
|
++ obsolete' [ "boot" "loader" "grub" "bootDevice" ]
|
|
|
|
++ obsolete' [ "boot" "initrd" "luks" "enable" ]
|
2014-04-29 18:57:04 +02:00
|
|
|
++ obsolete' [ "programs" "bash" "enable" ]
|
2014-09-24 23:05:03 +02:00
|
|
|
++ obsolete' [ "services" "samba" "defaultShare" ]
|
2014-10-14 15:20:27 +02:00
|
|
|
++ obsolete' [ "services" "syslog-ng" "serviceName" ]
|
2014-11-06 21:47:02 +01:00
|
|
|
++ obsolete' [ "services" "syslog-ng" "listenToJournal" ]
|
2015-06-30 17:25:30 +02:00
|
|
|
++ obsolete' [ "ec2" "metadata" ]
|
2013-10-23 18:22:26 +02:00
|
|
|
|
2013-10-23 18:51:55 +02:00
|
|
|
)
|