1

System: Install nps to search nixpkgs from a terminal environment

This commit is contained in:
2025-06-27 20:14:46 +02:00
parent 999fadb2ae
commit 44aec28df7
3 changed files with 151 additions and 78 deletions

View File

@ -9,6 +9,7 @@
config,
pkgs,
system,
username,
...
}:
with mylib.networking; {
@ -404,6 +405,9 @@ with mylib.networking; {
# Start dynamically linked executable using "nix-alien-ld -- <Executable>"
inputs.nix-alien.packages.${system}.nix-alien
# Search nixpkgs
inputs.nps.packages.${system}.default
# egl-wayland
];
@ -538,6 +542,33 @@ with mylib.networking; {
libvirtd.enable = true;
};
systemd = {
# TODO: Technically this should be a user service if it runs as ${username}?
timers."refresh-nps-cache" = {
wantedBy = ["timers.target"];
timerConfig = {
OnCalendar = "weekly"; # or however often you'd like
Persistent = true;
Unit = "refresh-nps-cache.service";
};
};
services."refresh-nps-cache" = {
# Make sure `nix` and `nix-env` are findable by systemd.services.
path = ["/run/current-system/sw/"];
serviceConfig = {
Type = "oneshot";
User = "${username}"; # ⚠️ replace with your "username" or "${user}", if it's defined
};
script = ''
set -eu
echo "Start refreshing nps cache..."
${inputs.nps.packages.${system}.default}/bin/nps -dddd -e -r
echo "... finished nps cache with exit code $?."
'';
};
};
# The current system was installed on 22.05, do not change.
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions