diff --git a/common/server/icecast.nix b/common/server/icecast.nix
new file mode 100644
index 0000000..9344282
--- /dev/null
+++ b/common/server/icecast.nix
@@ -0,0 +1,39 @@
+{ lib, config, ... }:
+
+let
+ cfg = config.services.icecast;
+in {
+ options.services.icecast = {
+ mount = lib.mkOption {
+ type = lib.types.str;
+ example = "stream.mp3";
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ listen.address = "127.0.0.1";
+ admin.password = "hackme";
+ extraConf = ''
+
+ hackme
+
+
+
+
+
+ /${cfg.mount}
+ 20
+ 65536
+ false
+ false
+
+ '';
+ };
+ services.nginx.virtualHosts.${cfg.hostname} = {
+ enableACME = true;
+ forceSSL = true;
+ locations."/${cfg.mount}" = {
+ proxyPass = "http://localhost:${toString cfg.listen.port}/${cfg.mount}";
+ };
+ };
+}
diff --git a/machines/mitty/configuration.nix b/machines/mitty/configuration.nix
index 95719af..3c5e273 100644
--- a/machines/mitty/configuration.nix
+++ b/machines/mitty/configuration.nix
@@ -26,26 +26,11 @@
services.nginx.enable = true;
- # # icecast
- # services.icecast = {
- # enable = true;
- # hostname = "mitty.neet.dev";
- # listen.port = 8000;
- # admin.password = builtins.readFile /secret/icecast.password;
- # };
- networking.firewall.allowedTCPPorts = [ 1935 ];
- services.peertube = {
+ # icecast
+ services.icecast = {
enable = true;
- configFile = ./peertube.yaml;
- };
- services.postfix.enable = true;
- services.redis.enable = true;
- services.nginx.virtualHosts."mitty.neet.dev" = {
- enableACME = true;
- forceSSL = true;
- locations."/" = {
- proxyPass = "http://localhost:9000";
- };
+ hostname = "mitty.neet.dev";
+ mount = "stream.mp3";
};
security.acme.acceptTerms = true;