Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

nixos/nscd: use nsncd by default

As announced in the NixOS 22.11 release notes, 23.05 will switch NixOS
to using nsncd (a non-caching reimplementation in Rust) as NSS lookup
dispatcher, instead of the buggy and deprecated glibc-provided nscd.

If you need to switch back, set `services.nscd.enableNsncd = false`, but
please open an issue in nixpkgs so your issue can be fixed.

+31 -14
+10
nixos/doc/manual/from_md/release-notes/rl-2305.section.xml
··· 529 529 </listitem> 530 530 <listitem> 531 531 <para> 532 + NixOS now defaults to using nsncd (a non-caching 533 + reimplementation in Rust) as NSS lookup dispatcher, instead of 534 + the buggy and deprecated glibc-provided nscd. If you need to 535 + switch back, set 536 + <literal>services.nscd.enableNsncd = false</literal>, but 537 + please open an issue in nixpkgs so your issue can be fixed. 538 + </para> 539 + </listitem> 540 + <listitem> 541 + <para> 532 542 The <literal>dnsmasq</literal> service now takes configuration 533 543 via the <literal>services.dnsmasq.settings</literal> attribute 534 544 set. The option
+2
nixos/doc/manual/release-notes/rl-2305.section.md
··· 130 130 131 131 DocBook option documentation support will be removed in the next release and CommonMark will become the default. DocBook option documentation that has not been migrated until then will no longer render properly or cause errors. 132 132 133 + - NixOS now defaults to using nsncd (a non-caching reimplementation in Rust) as NSS lookup dispatcher, instead of the buggy and deprecated glibc-provided nscd. If you need to switch back, set `services.nscd.enableNsncd = false`, but please open an issue in nixpkgs so your issue can be fixed. 134 + 133 135 - The `dnsmasq` service now takes configuration via the 134 136 `services.dnsmasq.settings` attribute set. The option 135 137 `services.dnsmasq.extraConfig` will be deprecated when NixOS 22.11 reaches
+7 -3
nixos/modules/services/system/nscd.nix
··· 29 29 30 30 enableNsncd = mkOption { 31 31 type = types.bool; 32 - default = false; 32 + default = true; 33 33 description = lib.mdDoc '' 34 - Whether to use nsncd instead of nscd. 34 + Whether to use nsncd instead of nscd from glibc. 35 35 This is a nscd-compatible daemon, that proxies lookups, without any caching. 36 + Using nscd from glibc is discouraged. 36 37 ''; 37 38 }; 38 39 ··· 55 56 config = mkOption { 56 57 type = types.lines; 57 58 default = builtins.readFile ./nscd.conf; 58 - description = lib.mdDoc "Configuration to use for Name Service Cache Daemon."; 59 + description = lib.mdDoc '' 60 + Configuration to use for Name Service Cache Daemon. 61 + Only used in case glibc-nscd is used. 62 + ''; 59 63 }; 60 64 61 65 package = mkOption {
+12 -11
nixos/tests/nscd.nix
··· 40 40 }; 41 41 42 42 specialisation = { 43 + withGlibcNscd.configuration = { ... }: { 44 + services.nscd.enableNsncd = false; 45 + }; 43 46 withUnscd.configuration = { ... }: { 47 + services.nscd.enableNsncd = false; 44 48 services.nscd.package = pkgs.unscd; 45 - }; 46 - withNsncd.configuration = { ... }: { 47 - services.nscd.enableNsncd = true; 48 49 }; 49 50 }; 50 51 }; ··· 118 119 test_host_lookups() 119 120 test_nss_myhostname() 120 121 122 + with subtest("glibc-nscd"): 123 + machine.succeed('${specialisations}/withGlibcNscd/bin/switch-to-configuration test') 124 + machine.wait_for_unit("default.target") 125 + 126 + test_dynamic_user() 127 + test_host_lookups() 128 + test_nss_myhostname() 129 + 121 130 with subtest("unscd"): 122 131 machine.succeed('${specialisations}/withUnscd/bin/switch-to-configuration test') 123 132 machine.wait_for_unit("default.target") ··· 129 138 130 139 # known to fail, unscd doesn't load external NSS modules 131 140 # test_nss_myhostname() 132 - 133 - with subtest("nsncd"): 134 - machine.succeed('${specialisations}/withNsncd/bin/switch-to-configuration test') 135 - machine.wait_for_unit("default.target") 136 - 137 - test_dynamic_user() 138 - test_host_lookups() 139 - test_nss_myhostname() 140 141 ''; 141 142 })