diff --git a/nixos/modules/misc/locate.nix b/nixos/modules/misc/locate.nix index 3cb5bb1a351..938c2d4401e 100644 --- a/nixos/modules/misc/locate.nix +++ b/nixos/modules/misc/locate.nix @@ -18,6 +18,7 @@ in { locate = mkOption { type = types.package; default = pkgs.findutils; + defaultText = "pkgs.findutils"; example = "pkgs.mlocate"; description = '' The locate implementation to use @@ -38,9 +39,6 @@ in { ''; }; - # This is no longer supported, but we keep it to give a better warning below - period = mkOption { visible = false; }; - extraFlags = mkOption { type = types.listOf types.str; default = [ ]; @@ -58,7 +56,7 @@ in { }; localuser = mkOption { - type = types.str; + type = types.nullOr types.str; default = "nobody"; description = '' The user to search non-network directories as, using @@ -76,10 +74,6 @@ in { }; config = { - warnings = - let opt = options.services.locate.period; in - 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."; - systemd.services.update-locatedb = { description = "Update Locate Database"; path = [ pkgs.su ]; @@ -87,7 +81,7 @@ in { '' mkdir -m 0755 -p $(dirname ${toString cfg.output}) exec ${cfg.locate}/bin/updatedb \ - --localuser=${cfg.localuser} \ + ${optionalString (cfg.localuser != null) ''--localuser=${cfg.localuser}''} \ ${optionalString (!cfg.includeStore) "--prunepaths='/nix/store'"} \ --output=${toString cfg.output} ${concatStringsSep " " cfg.extraFlags} ''; diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index 8d3c0a66ef4..5b4ac07199d 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -168,6 +168,9 @@ with lib; # dhcpd (mkRenamedOptionModule [ "services" "dhcpd" ] [ "services" "dhcpd4" ]) + # locate + (mkRenamedOptionModule [ "services" "locate" "period" ] [ "services" "locate" "interval" ]) + # Options that are obsolete and have no replacement. (mkRemovedOptionModule [ "boot" "initrd" "luks" "enable" ] "") (mkRemovedOptionModule [ "programs" "bash" "enable" ] "")