2024-06-12 18:09:56 +07:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.profile.podman;
|
2024-06-15 16:45:52 +07:00
|
|
|
username = config.profile.user.name;
|
2024-06-12 18:09:56 +07:00
|
|
|
in
|
|
|
|
{
|
|
|
|
config = lib.mkIf cfg.enable {
|
2024-06-15 16:45:52 +07:00
|
|
|
users.users.${username}.extraGroups = [ "podman" ];
|
2024-06-13 14:04:10 +07:00
|
|
|
# services.caddy.enable = true;
|
2024-06-12 18:09:56 +07:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
dive # look into docker image layers
|
|
|
|
podman-tui # status of containers in the terminal
|
|
|
|
podman-compose # start group of containers for dev
|
|
|
|
];
|
|
|
|
|
2024-06-12 22:56:21 +07:00
|
|
|
virtualisation.containers.enable = true;
|
|
|
|
virtualisation.oci-containers.backend = "podman";
|
2024-06-12 18:09:56 +07:00
|
|
|
virtualisation.podman = {
|
|
|
|
enable = true;
|
|
|
|
dockerSocket.enable = true;
|
|
|
|
autoPrune.enable = true; # Default weekly
|
|
|
|
dockerCompat = true;
|
2024-06-12 22:56:21 +07:00
|
|
|
defaultNetwork.settings.dns_enabled = true;
|
|
|
|
};
|
|
|
|
# https://madison-technologies.com/take-your-nixos-container-config-and-shove-it/
|
2024-06-15 16:45:52 +07:00
|
|
|
networking.firewall.interfaces."podman[0-9]+" = {
|
2024-06-12 22:56:21 +07:00
|
|
|
allowedUDPPorts = [ 53 ]; # this needs to be there so that containers can look eachother's names up over DNS
|
2024-06-12 18:09:56 +07:00
|
|
|
};
|
|
|
|
};
|
2024-06-12 22:56:21 +07:00
|
|
|
|
|
|
|
|
|
|
|
imports = [
|
|
|
|
./caddy.nix
|
2024-06-13 00:50:38 +07:00
|
|
|
./kavita.nix
|
2024-06-12 22:56:21 +07:00
|
|
|
];
|
2024-06-12 18:09:56 +07:00
|
|
|
}
|