locate: better mlocate support & cleanup

+6 -9
+3 -9
nixos/modules/misc/locate.nix
··· 18 18 locate = mkOption { 19 19 type = types.package; 20 20 default = pkgs.findutils; 21 + defaultText = "pkgs.findutils"; 21 22 example = "pkgs.mlocate"; 22 23 description = '' 23 24 The locate implementation to use ··· 38 39 ''; 39 40 }; 40 41 41 - # This is no longer supported, but we keep it to give a better warning below 42 - period = mkOption { visible = false; }; 43 - 44 42 extraFlags = mkOption { 45 43 type = types.listOf types.str; 46 44 default = [ ]; ··· 58 56 }; 59 57 60 58 localuser = mkOption { 61 - type = types.str; 59 + type = types.nullOr types.str; 62 60 default = "nobody"; 63 61 description = '' 64 62 The user to search non-network directories as, using ··· 76 74 }; 77 75 78 76 config = { 79 - warnings = 80 - let opt = options.services.locate.period; in 81 - optional opt.isDefined "The ‘services.locate.period’ option in ${showFiles opt.files} has been removed; please replace it with ‘services.locate.interval’, using the systemd.time(7) calendar event format."; 82 - 83 77 systemd.services.update-locatedb = 84 78 { description = "Update Locate Database"; 85 79 path = [ pkgs.su ]; ··· 87 81 '' 88 82 mkdir -m 0755 -p $(dirname ${toString cfg.output}) 89 83 exec ${cfg.locate}/bin/updatedb \ 90 - --localuser=${cfg.localuser} \ 84 + ${optionalString (cfg.localuser != null) ''--localuser=${cfg.localuser}''} \ 91 85 ${optionalString (!cfg.includeStore) "--prunepaths='/nix/store'"} \ 92 86 --output=${toString cfg.output} ${concatStringsSep " " cfg.extraFlags} 93 87 '';
+3
nixos/modules/rename.nix
··· 168 168 # dhcpd 169 169 (mkRenamedOptionModule [ "services" "dhcpd" ] [ "services" "dhcpd4" ]) 170 170 171 + # locate 172 + (mkRenamedOptionModule [ "services" "locate" "period" ] [ "services" "locate" "interval" ]) 173 + 171 174 # Options that are obsolete and have no replacement. 172 175 (mkRemovedOptionModule [ "boot" "initrd" "luks" "enable" ] "") 173 176 (mkRemovedOptionModule [ "programs" "bash" "enable" ] "")