nix-dotfiles/modules/hm/nix-index.nix

31 lines
818 B
Nix

{ config, lib, ... }: {
programs.nix-index = {
enable = true;
# package = pkgs.unstable_pkgs.nix-index;
enableBashIntegration = true;
enableZshIntegration = true;
};
systemd.user = lib.attrsets.optionalAttrs config.programs.nix-index.enable {
services."nix-index" = {
Unit = {
Description = "Update the nix-locate database";
After = [ "network.target" ];
};
Service = {
Type = "oneshot";
ExecStart = "${config.programs.nix-index.package}/bin/nix-index";
};
};
timers."nix-index" = {
Unit.Description = "Daily update the nix-locate database";
Timer = {
OnCalendar = "daily";
Persistent = true;
Unit = "nix-index.service";
};
Install.WantedBy = [ "timers.target" ];
};
};
}