diff --git a/nixos/viridian/containers/default.nix b/nixos/viridian/containers/default.nix index 4476721..95b4290 100644 --- a/nixos/viridian/containers/default.nix +++ b/nixos/viridian/containers/default.nix @@ -13,6 +13,8 @@ ./radarr.nix ./recyclarr.nix ./sonarr.nix + + ./microbin ]; virtualisation.oci-containers.backend = "docker"; } diff --git a/nixos/viridian/containers/microbin/default.nix b/nixos/viridian/containers/microbin/default.nix new file mode 100644 index 0000000..312b98f --- /dev/null +++ b/nixos/viridian/containers/microbin/default.nix @@ -0,0 +1,28 @@ +{ config, ... }: + +{ + age.secrets.microbin = { + # Environment variables for microbin + rekeyFile = ./environment.age; + owner = "root"; + group = "root"; + }; + + virtualisation.oci-containers.containers = { + # Self-hosted, open-source pastbin + microbin = { + autoStart = true; + image = "danielszabo99/microbin:2.0"; + ports = [ + "8181:8080/tcp" # WebUI + ]; + volumes = [ + # Container data + "/srv/containers/microbin:/app/microbin_data:rw" + ]; + environmentFiles = [ + config.age.secrets.microbin.path + ]; + }; + }; +} diff --git a/nixos/viridian/containers/microbin/environment.age b/nixos/viridian/containers/microbin/environment.age new file mode 100644 index 0000000..476dea4 Binary files /dev/null and b/nixos/viridian/containers/microbin/environment.age differ diff --git a/nixos/viridian/services/traefik/routers.nix b/nixos/viridian/services/traefik/routers.nix index 190064c..e1e20c9 100644 --- a/nixos/viridian/services/traefik/routers.nix +++ b/nixos/viridian/services/traefik/routers.nix @@ -122,6 +122,17 @@ ]; service = "jellyseerr"; }; + + microbin = { + rule = "Host(`bin.kanto.dev`)"; + entryPoints = [ + "websecure" + ]; + middlewares = [ + "internal" + ]; + service = "microbin"; + }; }; } diff --git a/nixos/viridian/services/traefik/services.nix b/nixos/viridian/services/traefik/services.nix index c61da94..43b9a29 100644 --- a/nixos/viridian/services/traefik/services.nix +++ b/nixos/viridian/services/traefik/services.nix @@ -32,6 +32,9 @@ jellyseerr.loadBalancer.servers = [ { url = "http://192.168.1.102:5055"; } ]; + microbin.loadBalancer.servers = [ + { url = "http://192.168.1.102:8181"; } + ]; }; }