nix-dotfiles/home_manager/modules/nix-index.nix
2022-05-09 18:30:11 +02:00

30 lines
690 B
Nix

{ pkgs, ... }:
{
programs.nix-index = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
systemd.user = {
services."nix-index" = {
Unit = {
Description = "Update the nix-locate database";
After = [ "network.target" ];
};
Install = {
WantedBy = [ "default.target" ];
};
Service = {
Type = "oneshot";
ExecStart = "${pkgs.nix-index}/bin/nix-index";
};
};
timers."nix-index" = {
Unit.Description = "Update the nix-locate database";
Time = { OnCalendar = "weekly"; Persistent = true; };
Install.WantedBy = [ "timers.target" ];
};
};
}