2022-04-27 00:21:19 +02:00
|
|
|
{ lib
|
|
|
|
, pkgs
|
|
|
|
, config
|
|
|
|
, ...
|
2022-03-01 22:19:03 +01:00
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.eboskma.docker;
|
2022-04-27 00:21:19 +02:00
|
|
|
in
|
|
|
|
{
|
2022-12-06 13:43:00 +01:00
|
|
|
options.eboskma.docker = {
|
2023-03-10 12:57:46 +01:00
|
|
|
enable = mkEnableOption "docker";
|
|
|
|
enableNvidia = mkEnableOption "docker NVidia support";
|
|
|
|
# enableTcpSocket = mkEnableOption "docker TCP socket";
|
2022-12-06 13:43:00 +01:00
|
|
|
};
|
2021-11-21 19:07:12 +01:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2022-04-27 00:21:19 +02:00
|
|
|
environment.systemPackages = with pkgs; [ docker-compose ];
|
2021-11-21 19:07:12 +01:00
|
|
|
|
2022-12-09 10:42:31 +01:00
|
|
|
virtualisation.docker = {
|
2021-11-21 19:07:12 +01:00
|
|
|
enable = true;
|
2022-12-06 13:43:00 +01:00
|
|
|
enableNvidia = cfg.enableNvidia;
|
2022-12-09 10:42:31 +01:00
|
|
|
|
|
|
|
autoPrune = {
|
2022-12-06 13:43:00 +01:00
|
|
|
enable = true;
|
2022-12-09 10:42:31 +01:00
|
|
|
dates = "weekly";
|
2022-12-06 13:43:00 +01:00
|
|
|
};
|
2022-12-22 11:35:17 +01:00
|
|
|
|
|
|
|
daemon.settings = {
|
|
|
|
insecure-registries = config.virtualisation.containers.registries.insecure;
|
2023-03-10 12:57:46 +01:00
|
|
|
features = {
|
|
|
|
buildkit = true;
|
|
|
|
};
|
2022-12-22 11:35:17 +01:00
|
|
|
};
|
2022-10-25 09:40:08 +02:00
|
|
|
};
|
2022-12-09 10:42:31 +01:00
|
|
|
|
2022-11-11 20:40:08 +01:00
|
|
|
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"
|
|
|
|
];
|
2022-05-26 11:32:30 +02:00
|
|
|
};
|
2021-11-21 19:07:12 +01:00
|
|
|
};
|
|
|
|
|
2022-10-25 09:40:08 +02:00
|
|
|
users.extraUsers.${config.eboskma.var.mainUser}.extraGroups = [ "docker" "podman" ];
|
2022-12-09 10:42:31 +01:00
|
|
|
|
|
|
|
# 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
|
|
|
|
# '';
|
|
|
|
# };
|
|
|
|
# };
|
2021-11-21 19:07:12 +01:00
|
|
|
};
|
|
|
|
}
|