Merge pull request #14311 from Profpatsch/mkRemovedOptionModule-replacement

mkRemovedOptionModule: add replacement argument

authored by

Domen Kožar and committed by
GitHub
4af09e00 21f2f307

+63 -21
+10 -4
lib/modules.nix
··· 503 503 /* Return a module that causes a warning to be shown if the 504 504 specified option is defined. For example, 505 505 506 - mkRemovedOptionModule [ "boot" "loader" "grub" "bootDevice" ] 506 + mkRemovedOptionModule [ "boot" "loader" "grub" "bootDevice" ] "<replacement instructions>" 507 507 508 508 causes a warning if the user defines boot.loader.grub.bootDevice. 509 + 510 + replacementInstructions is a string that provides instructions on 511 + how to achieve the same functionality without the removed option, 512 + or alternatively a reasoning why the functionality is not needed. 513 + replacementInstructions SHOULD be provided! 509 514 */ 510 - mkRemovedOptionModule = optionName: 515 + mkRemovedOptionModule = optionName: replacementInstructions: 511 516 { options, ... }: 512 517 { options = setAttrByPath optionName (mkOption { 513 518 visible = false; 514 519 }); 515 520 config.warnings = 516 521 let opt = getAttrFromPath optionName options; in 517 - optional opt.isDefined 518 - "The option definition `${showOption optionName}' in ${showFiles opt.files} no longer has any effect; please remove it."; 522 + optional opt.isDefined '' 523 + The option definition `${showOption optionName}' in ${showFiles opt.files} no longer has any effect; please remove it. 524 + ${replacementInstructions}''; 519 525 }; 520 526 521 527 /* Return a module that causes a warning to be shown if the
+35
nixos/doc/manual/release-notes/rl-1603.xml
··· 385 385 the github issue</link>. 386 386 </para> 387 387 </listitem> 388 + 389 + <listitem> 390 + <para> 391 + The <literal>services.xserver.startGnuPGAgent</literal> option has been removed. 392 + GnuPG 2.1.x changed the way the gpg-agent works, and that new approach no 393 + longer requires (or even supports) the "start everything as a child of the 394 + agent" scheme we've implemented in NixOS for older versions. 395 + To configure the gpg-agent for your X session, add the following code to 396 + <filename>~/.bashrc</filename> or some file that’s sourced when your shell is started: 397 + <programlisting> 398 + GPG_TTY=$(tty) 399 + export GPG_TTY 400 + </programlisting> 401 + If you want to use gpg-agent for SSH, too, add the following to your session 402 + initialization (e.g. <literal>displayManager.sessionCommands</literal>) 403 + <programlisting> 404 + gpg-connect-agent /bye 405 + unset SSH_AGENT_PID 406 + export SSH_AUTH_SOCK="''${HOME}/.gnupg/S.gpg-agent.ssh" 407 + </programlisting> 408 + and make sure that 409 + <programlisting> 410 + enable-ssh-support 411 + </programlisting> 412 + is included in your <filename>~/.gnupg/gpg-agent.conf</filename>. 413 + You will need to use <command>ssh-add</command> to re-add your ssh keys. 414 + If gpg’s automatic transformation of the private keys to the new format fails, 415 + you will need to re-import your private keyring as well: 416 + <programlisting> 417 + gpg --import ~/.gnupg/secring.gpg 418 + </programlisting> 419 + The <command>gpg-agent(1)</command> man page has more details about this subject, 420 + i.e. in the "EXAMPLES" section. 421 + </para> 422 + </listitem> 388 423 </itemizedlist> 389 424 390 425
+15 -15
nixos/modules/rename.nix
··· 29 29 (mkRenamedOptionModule [ "jobs" ] [ "systemd" "services" ]) 30 30 31 31 (mkRenamedOptionModule [ "services" "gitlab" "stateDir" ] [ "services" "gitlab" "statePath" ]) 32 - (mkRemovedOptionModule [ "services" "gitlab" "satelliteDir" ]) 32 + (mkRemovedOptionModule [ "services" "gitlab" "satelliteDir" ] "") 33 33 34 34 # Old Grub-related options. 35 35 (mkRenamedOptionModule [ "boot" "initrd" "extraKernelModules" ] [ "boot" "initrd" "kernelModules" ]) ··· 112 112 (mkRenamedOptionModule [ "services" "iodined" "domain" ] [ "services" "iodine" "server" "domain" ]) 113 113 (mkRenamedOptionModule [ "services" "iodined" "ip" ] [ "services" "iodine" "server" "ip" ]) 114 114 (mkRenamedOptionModule [ "services" "iodined" "extraConfig" ] [ "services" "iodine" "server" "extraConfig" ]) 115 - (mkRemovedOptionModule [ "services" "iodined" "client" ]) 115 + (mkRemovedOptionModule [ "services" "iodined" "client" ] "") 116 116 117 117 # Grsecurity 118 118 (mkRemovedOptionModule [ "security" "grsecurity" "kernelPatch" ]) ··· 141 141 (mkRenamedOptionModule [ "fonts" "fontconfig" "ultimate" "rendering" ] [ "fonts" "fontconfig" "ultimate" "preset" ]) 142 142 143 143 # Options that are obsolete and have no replacement. 144 - (mkRemovedOptionModule [ "boot" "initrd" "luks" "enable" ]) 145 - (mkRemovedOptionModule [ "programs" "bash" "enable" ]) 146 - (mkRemovedOptionModule [ "services" "samba" "defaultShare" ]) 147 - (mkRemovedOptionModule [ "services" "syslog-ng" "serviceName" ]) 148 - (mkRemovedOptionModule [ "services" "syslog-ng" "listenToJournal" ]) 149 - (mkRemovedOptionModule [ "ec2" "metadata" ]) 150 - (mkRemovedOptionModule [ "services" "openvpn" "enable" ]) 151 - (mkRemovedOptionModule [ "services" "printing" "cupsFilesConf" ]) 152 - (mkRemovedOptionModule [ "services" "printing" "cupsdConf" ]) 153 - (mkRemovedOptionModule [ "services" "xserver" "startGnuPGAgent" ]) 154 - (mkRemovedOptionModule [ "services" "phpfpm" "phpIni" ]) 155 - (mkRemovedOptionModule [ "services" "dovecot2" "package" ]) 156 - 144 + (mkRemovedOptionModule [ "boot" "initrd" "luks" "enable" ] "") 145 + (mkRemovedOptionModule [ "programs" "bash" "enable" ] "") 146 + (mkRemovedOptionModule [ "services" "samba" "defaultShare" ] "") 147 + (mkRemovedOptionModule [ "services" "syslog-ng" "serviceName" ] "") 148 + (mkRemovedOptionModule [ "services" "syslog-ng" "listenToJournal" ] "") 149 + (mkRemovedOptionModule [ "ec2" "metadata" ] "") 150 + (mkRemovedOptionModule [ "services" "openvpn" "enable" ] "") 151 + (mkRemovedOptionModule [ "services" "printing" "cupsFilesConf" ] "") 152 + (mkRemovedOptionModule [ "services" "printing" "cupsdConf" ] "") 153 + (mkRemovedOptionModule [ "services" "xserver" "startGnuPGAgent" ] 154 + "See the 16.03 release notes for more information.") 155 + (mkRemovedOptionModule [ "services" "phpfpm" "phpIni" ] "") 156 + (mkRemovedOptionModule [ "services" "dovecot2" "package" ] "") 157 157 ]; 158 158 }
+2 -1
nixos/modules/services/x11/display-managers/default.nix
··· 306 306 }; 307 307 308 308 imports = [ 309 - (mkRemovedOptionModule [ "services" "xserver" "displayManager" "desktopManagerHandlesLidAndPower" ]) 309 + (mkRemovedOptionModule [ "services" "xserver" "displayManager" "desktopManagerHandlesLidAndPower" ] 310 + "The option is no longer necessary because all display managers have already delegated lid management to systemd.") 310 311 ]; 311 312 312 313 }
+1 -1
nixos/modules/system/boot/loader/grub/grub.nix
··· 500 500 501 501 502 502 imports = 503 - [ (mkRemovedOptionModule [ "boot" "loader" "grub" "bootDevice" ]) 503 + [ (mkRemovedOptionModule [ "boot" "loader" "grub" "bootDevice" ] "") 504 504 (mkRenamedOptionModule [ "boot" "copyKernels" ] [ "boot" "loader" "grub" "copyKernels" ]) 505 505 (mkRenamedOptionModule [ "boot" "extraGrubEntries" ] [ "boot" "loader" "grub" "extraEntries" ]) 506 506 (mkRenamedOptionModule [ "boot" "extraGrubEntriesBeforeNixos" ] [ "boot" "loader" "grub" "extraEntriesBeforeNixOS" ])