config/profiles/oci/distrobox.nix
2024-10-19 04:05:19 +02:00

57 lines
1.5 KiB
Nix

{ pkgs, config, ... }:
/*
# via https://distrobox.it/compatibility/#containers-distros
use --nvidia for cuda support
distrobox create --name alpine --init --yes --image docker.io/libary/alpine:latest
distrobox create --name arch --init --yes --image docker.io/libary/archlinux:latest
distrobox create --name debian --init --yes --image docker.io/libary/debian:testing
distrobox create --name fedora --init --yes --image quay.io/fedora/fedora:rawhide
distrobox create --name gentoo --init --yes --image docker.io/gentoo/stage3:latest
#distrobox create --name ubuntu --init --yes --image quay.io/toolbx/ubuntu-toolbox:latest
*/
{
assertions = [
{
assertion = config.virtualisation.docker.enable || config.virtualisation.podman.enable;
message = "distrobox requires either podman or docker";
}
];
environment.systemPackages = [
pkgs.distrobox
];
# ++ lib.optionals (!config.virtualisation.docker.enable && !config.virtualisation.podman.enable) [
# pkgs.lilipod
#];
# update periodically
systemd.user = {
timers."distrobox-update" = {
enable = config.system.autoUpgrade.enable;
wantedBy = ["timers.target"];
timerConfig = {
OnBootSec = "1h";
OnUnitActiveSec = "1d";
Unit = "distrobox-update.service";
};
};
services."distrobox-update" = {
enable = config.system.autoUpgrade.enable;
script = ''
${pkgs.distrobox}/bin/distrobox upgrade --all
'';
serviceConfig = {
Type = "oneshot";
};
};
};
}