locate: better mlocate support & cleanup

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