config/profiles/oci/distrobox.nix

40 lines
763 B
Nix
Raw Normal View History

2024-03-24 03:11:53 +01:00
{ pkgs, config, ... }:
{
assertions = [
{
assertion = config.virtualisation.docker.enable || config.virtualisation.podman.enable;
message = "distrobox requires either podman or docker";
}
];
environment.systemPackages = [
pkgs.distrobox
];
# update periodically
systemd.user = {
timers."distrobox-update" = {
enable = true;
wantedBy = ["timers.target"];
timerConfig = {
OnBootSec = "1h";
OnUnitActiveSec = "1d";
Unit = "distrobox-update.service";
};
};
services."distrobox-update" = {
enable = true;
script = ''
${pkgs.distrobox}/bin/distrobox upgrade --all
'';
serviceConfig = {
Type = "oneshot";
};
};
};
}