tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
locate: better mlocate support & cleanup
Gregor Kleen
9 years ago
114e738e
142696de
+6
-9
2 changed files
expand all
collapse all
unified
split
nixos
modules
misc
locate.nix
rename.nix
+3
-9
nixos/modules/misc/locate.nix
···
18
18
locate = mkOption {
19
19
type = types.package;
20
20
default = pkgs.findutils;
21
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
41
-
# This is no longer supported, but we keep it to give a better warning below
42
42
-
period = mkOption { visible = false; };
43
43
-
44
42
extraFlags = mkOption {
45
43
type = types.listOf types.str;
46
44
default = [ ];
···
58
56
};
59
57
60
58
localuser = mkOption {
61
61
-
type = types.str;
59
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
79
-
warnings =
80
80
-
let opt = options.services.locate.period; in
81
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
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
90
-
--localuser=${cfg.localuser} \
84
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
171
+
# locate
172
172
+
(mkRenamedOptionModule [ "services" "locate" "period" ] [ "services" "locate" "interval" ])
173
173
+
171
174
# Options that are obsolete and have no replacement.
172
175
(mkRemovedOptionModule [ "boot" "initrd" "luks" "enable" ] "")
173
176
(mkRemovedOptionModule [ "programs" "bash" "enable" ] "")