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
|
|
|
|
];
|
|
|
|
|
2024-06-18 00:15:06 +07:00
|
|
|
systemd.timers."podman-auto-update" = {
|
|
|
|
enable = true;
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
2024-09-09 00:07:55 +07:00
|
|
|
timerConfig = {
|
|
|
|
OnCalendar = "*-*-* 04:00:00";
|
|
|
|
};
|
2024-06-18 00:15:06 +07:00
|
|
|
};
|
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
|
|
|
|
|
|
|
|
2024-06-17 19:57:53 +07:00
|
|
|
# Taken IP-Range Subnets
|
|
|
|
#
|
2024-06-18 19:39:41 +07:00
|
|
|
# 10.88.0.2 -> Redmage
|
|
|
|
# 10.88.0.3 -> Redmage Demo
|
2024-06-18 19:38:41 +07:00
|
|
|
# 10.88.0.4 -> ytptube
|
|
|
|
# 10.88.0.5 -> Suwayomi
|
|
|
|
# 10.88.0.6 -> Suwayomi Flaresolverr
|
2024-06-18 19:39:41 +07:00
|
|
|
# 10.88.1.1 -> Pihole
|
2024-06-12 22:56:21 +07:00
|
|
|
imports = [
|
2024-07-28 22:18:27 +07:00
|
|
|
./memos.nix
|
2024-07-20 18:46:31 +07:00
|
|
|
./minecraft.nix
|
2024-08-09 22:10:25 +07:00
|
|
|
./morphos.nix
|
2024-07-15 15:16:53 +07:00
|
|
|
./openobserve.nix
|
2024-06-17 01:06:03 +07:00
|
|
|
./pihole.nix
|
2024-06-18 21:00:43 +07:00
|
|
|
./qbittorrent.nix
|
2024-06-18 20:09:42 +07:00
|
|
|
./redmage-demo.nix
|
|
|
|
./redmage.nix
|
2024-07-15 15:16:53 +07:00
|
|
|
./servarr
|
2024-08-20 21:32:35 +07:00
|
|
|
./soulseek.nix
|
2024-06-17 19:54:36 +07:00
|
|
|
./suwayomi.nix
|
2024-06-17 21:49:20 +07:00
|
|
|
./ytptube.nix
|
2024-09-08 19:42:57 +07:00
|
|
|
./valheim.nix
|
2024-09-10 22:53:42 +07:00
|
|
|
|
|
|
|
./metrics.nix
|
2024-06-12 22:56:21 +07:00
|
|
|
];
|
2024-06-12 18:09:56 +07:00
|
|
|
}
|