nixos-config/modules/docker/default.nix

52 lines
1.3 KiB
Nix

{ lib
, pkgs
, config
, ...
}:
with lib; let
cfg = config.eboskma.docker;
in
{
options.eboskma.docker = {
enable = mkEnableOption "podman";
enableNvidia = mkEnableOption "podman NVidia support";
enableTcpSocket = mkEnableOption "podman TCP socket";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ docker-compose ];
virtualisation.podman = {
enable = true;
enableNvidia = cfg.enableNvidia;
networkSocket = mkIf cfg.enableTcpSocket {
enable = true;
openFirewall = true;
};
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" ];
search = [
"docker.io"
"quay.io"
"docker02.bedum.horus.nu:5000"
"yocto-build-server.bedum.horus.nu:5000"
"containers.internal.horus.nu"
];
};
};
# virtualisation.oci-containers.backend = "podman";
users.extraUsers.${config.eboskma.var.mainUser}.extraGroups = [ "docker" "podman" ];
};
}