Add nvidia support to docker module

This commit is contained in:
Erwin Boskma 2022-12-09 10:42:31 +01:00
parent 201090eee6
commit d9e13fb4b3
Signed by: erwin
SSH key fingerprint: SHA256:Vw4O4qA0i5x65Y7yyjDpWDCSMSXAhqT4X7cJ3frdnLY

View file

@ -16,22 +16,16 @@ in
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ docker-compose ];
virtualisation.podman = {
virtualisation.docker = {
enable = true;
enableNvidia = cfg.enableNvidia;
networkSocket = mkIf cfg.enableTcpSocket {
autoPrune = {
enable = true;
openFirewall = true;
dates = "weekly";
};
dockerSocket.enable = true;
dockerCompat = true;
defaultNetwork.dnsname.enable = true;
};
# virtualisation.docker = {
# autoPrune = {
# enable = true;
# dates = "weekly";
# };
virtualisation.containers = {
registries = {
insecure = [ "docker02.bedum.horus.nu:5000" "yocto-build-server.bedum.horus.nu:5000" "containers.internal.horus.nu" ];
@ -45,8 +39,20 @@ in
};
};
# virtualisation.oci-containers.backend = "podman";
users.extraUsers.${config.eboskma.var.mainUser}.extraGroups = [ "docker" "podman" ];
# services.ghostunnel = mkIf cfg.enableTcpSocket {
# enable = true;
# servers."podman-socket" = {
# listen = "0.0.0.0:2376";
# target = "unix:/run/podman/podman.sock";
# allowAll = mkDefault true;
# extraArguments = ''
# --auto-acme-cert=mimir.internal.horus.nu
# --auto-acme-email=erwin@horus.nu
# --auto-acme-ca=https://mimir.internal.horus.nu
# '';
# };
# };
};
}