config/profiles/oci/distrobox.nix

40 lines
763 B
Nix

{ 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";
};
};
};
}