diff options
author | Domen Kožar <domen@dev.si> | 2016-08-28 13:55:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-28 13:55:28 +0200 |
commit | 4af09e00311b3c024395b59261a32a5a6a43e3fa (patch) | |
tree | 8b72eea81b13aa7ec016fe225f927fa579ff6b4f | |
parent | 21f2f3074063017a6580fc1c5889ee54094160ff (diff) | |
parent | 16c923cef2152d58878abac023816f05605c1f7d (diff) | |
download | nixlib-4af09e00311b3c024395b59261a32a5a6a43e3fa.tar nixlib-4af09e00311b3c024395b59261a32a5a6a43e3fa.tar.gz nixlib-4af09e00311b3c024395b59261a32a5a6a43e3fa.tar.bz2 nixlib-4af09e00311b3c024395b59261a32a5a6a43e3fa.tar.lz nixlib-4af09e00311b3c024395b59261a32a5a6a43e3fa.tar.xz nixlib-4af09e00311b3c024395b59261a32a5a6a43e3fa.tar.zst nixlib-4af09e00311b3c024395b59261a32a5a6a43e3fa.zip |
Merge pull request #14311 from Profpatsch/mkRemovedOptionModule-replacement
mkRemovedOptionModule: add replacement argument
-rw-r--r-- | lib/modules.nix | 14 | ||||
-rw-r--r-- | nixos/doc/manual/release-notes/rl-1603.xml | 35 | ||||
-rw-r--r-- | nixos/modules/rename.nix | 30 | ||||
-rw-r--r-- | nixos/modules/services/x11/display-managers/default.nix | 3 | ||||
-rw-r--r-- | nixos/modules/system/boot/loader/grub/grub.nix | 2 |
5 files changed, 63 insertions, 21 deletions
diff --git a/lib/modules.nix b/lib/modules.nix index e2fa3d7fbf0c..080974a61305 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -503,19 +503,25 @@ rec { /* Return a module that causes a warning to be shown if the specified option is defined. For example, - mkRemovedOptionModule [ "boot" "loader" "grub" "bootDevice" ] + mkRemovedOptionModule [ "boot" "loader" "grub" "bootDevice" ] "<replacement instructions>" causes a warning if the user defines boot.loader.grub.bootDevice. + + replacementInstructions is a string that provides instructions on + how to achieve the same functionality without the removed option, + or alternatively a reasoning why the functionality is not needed. + replacementInstructions SHOULD be provided! */ - mkRemovedOptionModule = optionName: + mkRemovedOptionModule = optionName: replacementInstructions: { options, ... }: { options = setAttrByPath optionName (mkOption { visible = false; }); config.warnings = let opt = getAttrFromPath optionName options; in - optional opt.isDefined - "The option definition `${showOption optionName}' in ${showFiles opt.files} no longer has any effect; please remove it."; + optional opt.isDefined '' + The option definition `${showOption optionName}' in ${showFiles opt.files} no longer has any effect; please remove it. + ${replacementInstructions}''; }; /* Return a module that causes a warning to be shown if the diff --git a/nixos/doc/manual/release-notes/rl-1603.xml b/nixos/doc/manual/release-notes/rl-1603.xml index c51316bd2808..f460e00e836e 100644 --- a/nixos/doc/manual/release-notes/rl-1603.xml +++ b/nixos/doc/manual/release-notes/rl-1603.xml @@ -385,6 +385,41 @@ services.syncthing = { the github issue</link>. </para> </listitem> + + <listitem> + <para> + The <literal>services.xserver.startGnuPGAgent</literal> option has been removed. + GnuPG 2.1.x changed the way the gpg-agent works, and that new approach no + longer requires (or even supports) the "start everything as a child of the + agent" scheme we've implemented in NixOS for older versions. + To configure the gpg-agent for your X session, add the following code to + <filename>~/.bashrc</filename> or some file that’s sourced when your shell is started: + <programlisting> +GPG_TTY=$(tty) +export GPG_TTY + </programlisting> + If you want to use gpg-agent for SSH, too, add the following to your session + initialization (e.g. <literal>displayManager.sessionCommands</literal>) + <programlisting> +gpg-connect-agent /bye +unset SSH_AGENT_PID +export SSH_AUTH_SOCK="''${HOME}/.gnupg/S.gpg-agent.ssh" + </programlisting> + and make sure that + <programlisting> +enable-ssh-support + </programlisting> + is included in your <filename>~/.gnupg/gpg-agent.conf</filename>. + You will need to use <command>ssh-add</command> to re-add your ssh keys. + If gpg’s automatic transformation of the private keys to the new format fails, + you will need to re-import your private keyring as well: + <programlisting> +gpg --import ~/.gnupg/secring.gpg + </programlisting> + The <command>gpg-agent(1)</command> man page has more details about this subject, + i.e. in the "EXAMPLES" section. + </para> + </listitem> </itemizedlist> diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index 3caac6c4ee60..0f10ecd4de71 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -29,7 +29,7 @@ with lib; (mkRenamedOptionModule [ "jobs" ] [ "systemd" "services" ]) (mkRenamedOptionModule [ "services" "gitlab" "stateDir" ] [ "services" "gitlab" "statePath" ]) - (mkRemovedOptionModule [ "services" "gitlab" "satelliteDir" ]) + (mkRemovedOptionModule [ "services" "gitlab" "satelliteDir" ] "") # Old Grub-related options. (mkRenamedOptionModule [ "boot" "initrd" "extraKernelModules" ] [ "boot" "initrd" "kernelModules" ]) @@ -112,7 +112,7 @@ with lib; (mkRenamedOptionModule [ "services" "iodined" "domain" ] [ "services" "iodine" "server" "domain" ]) (mkRenamedOptionModule [ "services" "iodined" "ip" ] [ "services" "iodine" "server" "ip" ]) (mkRenamedOptionModule [ "services" "iodined" "extraConfig" ] [ "services" "iodine" "server" "extraConfig" ]) - (mkRemovedOptionModule [ "services" "iodined" "client" ]) + (mkRemovedOptionModule [ "services" "iodined" "client" ] "") # Grsecurity (mkRemovedOptionModule [ "security" "grsecurity" "kernelPatch" ]) @@ -141,18 +141,18 @@ with lib; (mkRenamedOptionModule [ "fonts" "fontconfig" "ultimate" "rendering" ] [ "fonts" "fontconfig" "ultimate" "preset" ]) # Options that are obsolete and have no replacement. - (mkRemovedOptionModule [ "boot" "initrd" "luks" "enable" ]) - (mkRemovedOptionModule [ "programs" "bash" "enable" ]) - (mkRemovedOptionModule [ "services" "samba" "defaultShare" ]) - (mkRemovedOptionModule [ "services" "syslog-ng" "serviceName" ]) - (mkRemovedOptionModule [ "services" "syslog-ng" "listenToJournal" ]) - (mkRemovedOptionModule [ "ec2" "metadata" ]) - (mkRemovedOptionModule [ "services" "openvpn" "enable" ]) - (mkRemovedOptionModule [ "services" "printing" "cupsFilesConf" ]) - (mkRemovedOptionModule [ "services" "printing" "cupsdConf" ]) - (mkRemovedOptionModule [ "services" "xserver" "startGnuPGAgent" ]) - (mkRemovedOptionModule [ "services" "phpfpm" "phpIni" ]) - (mkRemovedOptionModule [ "services" "dovecot2" "package" ]) - + (mkRemovedOptionModule [ "boot" "initrd" "luks" "enable" ] "") + (mkRemovedOptionModule [ "programs" "bash" "enable" ] "") + (mkRemovedOptionModule [ "services" "samba" "defaultShare" ] "") + (mkRemovedOptionModule [ "services" "syslog-ng" "serviceName" ] "") + (mkRemovedOptionModule [ "services" "syslog-ng" "listenToJournal" ] "") + (mkRemovedOptionModule [ "ec2" "metadata" ] "") + (mkRemovedOptionModule [ "services" "openvpn" "enable" ] "") + (mkRemovedOptionModule [ "services" "printing" "cupsFilesConf" ] "") + (mkRemovedOptionModule [ "services" "printing" "cupsdConf" ] "") + (mkRemovedOptionModule [ "services" "xserver" "startGnuPGAgent" ] + "See the 16.03 release notes for more information.") + (mkRemovedOptionModule [ "services" "phpfpm" "phpIni" ] "") + (mkRemovedOptionModule [ "services" "dovecot2" "package" ] "") ]; } diff --git a/nixos/modules/services/x11/display-managers/default.nix b/nixos/modules/services/x11/display-managers/default.nix index 1c928ff22a1f..75d80609f73f 100644 --- a/nixos/modules/services/x11/display-managers/default.nix +++ b/nixos/modules/services/x11/display-managers/default.nix @@ -306,7 +306,8 @@ in }; imports = [ - (mkRemovedOptionModule [ "services" "xserver" "displayManager" "desktopManagerHandlesLidAndPower" ]) + (mkRemovedOptionModule [ "services" "xserver" "displayManager" "desktopManagerHandlesLidAndPower" ] + "The option is no longer necessary because all display managers have already delegated lid management to systemd.") ]; } diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix index 0640ec306e18..46776f45d96b 100644 --- a/nixos/modules/system/boot/loader/grub/grub.nix +++ b/nixos/modules/system/boot/loader/grub/grub.nix @@ -500,7 +500,7 @@ in imports = - [ (mkRemovedOptionModule [ "boot" "loader" "grub" "bootDevice" ]) + [ (mkRemovedOptionModule [ "boot" "loader" "grub" "bootDevice" ] "") (mkRenamedOptionModule [ "boot" "copyKernels" ] [ "boot" "loader" "grub" "copyKernels" ]) (mkRenamedOptionModule [ "boot" "extraGrubEntries" ] [ "boot" "loader" "grub" "extraEntries" ]) (mkRenamedOptionModule [ "boot" "extraGrubEntriesBeforeNixos" ] [ "boot" "loader" "grub" "extraEntriesBeforeNixOS" ]) |