diff options
| -rw-r--r-- | flake.nix | 2 | ||||
| -rw-r--r-- | hosts/ganymede/config.nix | 10 | ||||
| -rw-r--r-- | hosts/ganymede/minecraft.nix | 22 | ||||
| -rw-r--r-- | hosts/ganymede/nixos.nix | 5 | ||||
| -rw-r--r-- | hosts/mercury/hjem.nix | 2 | ||||
| -rw-r--r-- | modules/services/nixos/agate.nix | 22 | ||||
| -rw-r--r-- | modules/services/nixos/default.nix | 2 | ||||
| -rw-r--r-- | modules/services/nixos/minecraft.nix | 28 | ||||
| -rw-r--r-- | modules/services/options.nix | 21 |
9 files changed, 88 insertions, 26 deletions
@@ -89,7 +89,5 @@ pkgs = buildPkgs; }; }; - - projects."nixos-rb" = ./pkgs/yo/nixos.rb; }; } diff --git a/hosts/ganymede/config.nix b/hosts/ganymede/config.nix index ee397d0..b968e3f 100644 --- a/hosts/ganymede/config.nix +++ b/hosts/ganymede/config.nix @@ -77,6 +77,16 @@ privateUrl = "git.ganymede"; }; + agate = { + enable = true; + publicUrl = "williamsfam.us.com"; + }; + + minecraft = { + enable = true; + listenAddr = "0.0.0.0"; + }; + polaris = { enable = true; privateUrl = "music.ganymede"; diff --git a/hosts/ganymede/minecraft.nix b/hosts/ganymede/minecraft.nix deleted file mode 100644 index c244868..0000000 --- a/hosts/ganymede/minecraft.nix +++ /dev/null @@ -1,22 +0,0 @@ -{config, ...}: { - networking.firewall.allowedUDPPorts = [19132]; - virtualisation.oci-containers.backend = "docker"; - - virtualisation.oci-containers.containers."Minecraft" = { - environment = { - EULA = "TRUE"; - EMIT_SERVER_TELEMETRY = "true"; - - SERVER_NAME = "YServer"; - TZ = config.time.timeZone; - VERSION = "1.21.131.1"; - CONTENT_LOG_FILE_ENABLED = "false"; - - ALLOW_CHEATS = "false"; - DIFFICULTY = "1"; - }; - image = "itzg/minecraft-bedrock-server"; - ports = ["0.0.0.0:19132:19132/udp"]; - volumes = ["/var/lib/minecraft/:/data"]; - }; -} diff --git a/hosts/ganymede/nixos.nix b/hosts/ganymede/nixos.nix index 14be488..5d56c95 100644 --- a/hosts/ganymede/nixos.nix +++ b/hosts/ganymede/nixos.nix @@ -7,14 +7,15 @@ }: { imports = [ inputs.disko.nixosModules.disko + inputs.nixos-facter-modules.nixosModules.facter ./disks.nix - ./minecraft.nix - ./iwlwifi.nix ./caddy.nix ]; + facter.reportPath = ./facter.json; + # backup usb teather configuration systemd.network.networks."80-usb-teather" = { name = "enp0s20f0u2"; diff --git a/hosts/mercury/hjem.nix b/hosts/mercury/hjem.nix index bb08a33..d066f69 100644 --- a/hosts/mercury/hjem.nix +++ b/hosts/mercury/hjem.nix @@ -8,6 +8,8 @@ prismlauncher mpv + lagrange + musescore vital diff --git a/modules/services/nixos/agate.nix b/modules/services/nixos/agate.nix new file mode 100644 index 0000000..f1593e6 --- /dev/null +++ b/modules/services/nixos/agate.nix @@ -0,0 +1,22 @@ +{ + lib, + config, + ... +}: let + cfg = config.collinux.services.agate; +in + lib.mkIf cfg.enable { + services.agate = { + enable = true; + addresses = [ + "0.0.0.0:1965" + ]; + hostnames = [cfg.publicUrl]; + + onlyTls_1_3 = true; + + contentDir = "/media/public/gmi"; + }; + + networking.firewall.allowedTCPPorts = [1965]; + } diff --git a/modules/services/nixos/default.nix b/modules/services/nixos/default.nix index 8f7c929..d0e170c 100644 --- a/modules/services/nixos/default.nix +++ b/modules/services/nixos/default.nix @@ -11,6 +11,8 @@ ./polaris.nix # ./mopidy.nix # ./jellyfin.nix + ./agate.nix + ./minecraft.nix ./copyparty.nix ./qbittorrent.nix ]; diff --git a/modules/services/nixos/minecraft.nix b/modules/services/nixos/minecraft.nix new file mode 100644 index 0000000..ed3ee1a --- /dev/null +++ b/modules/services/nixos/minecraft.nix @@ -0,0 +1,28 @@ +{ + lib, + config, + ... +}: let + cfg = config.collinux.services.minecraft; +in + lib.mkIf cfg.enable { + networking.firewall.allowedUDPPorts = lib.optional (cfg.listenAddr == "0.0.0.0") cfg.port; + + virtualisation.oci-containers.containers."Minecraft" = { + environment = { + EULA = "TRUE"; + EMIT_SERVER_TELEMETRY = "true"; + + SERVER_NAME = "YServer"; + TZ = config.time.timeZone; + VERSION = "1.21.131.1"; + CONTENT_LOG_FILE_ENABLED = "false"; + + ALLOW_CHEATS = "false"; + DIFFICULTY = "1"; + }; + image = "itzg/minecraft-bedrock-server"; + ports = ["${cfg.listenAddr}:${toString cfg.port}:19132/udp"]; + volumes = ["/var/lib/minecraft/:/data"]; + }; + } diff --git a/modules/services/options.nix b/modules/services/options.nix index 16c5bea..5744471 100644 --- a/modules/services/options.nix +++ b/modules/services/options.nix @@ -98,6 +98,14 @@ in { reverse_proxy = false; }; + agate = { + enable = mkEnableOption "Agate Gemini Protocol Server"; + publicUrl = mkOption { + description = "domain to run this gemini server on"; + type = lib.types.str; + }; + }; + polaris = webserviceOptions { service_name = "polaris"; default_port = 8079; @@ -135,6 +143,19 @@ in { }; }; + minecraft = { + enable = mkEnableOption "Minecraft bedrock server"; + listenAddr = mkOption { + description = "Address to listen on"; + type = ipAddr; + default = "127.0.0.1"; + }; + port = mkOption { + type = lib.types.port; + default = 19132; + }; + }; + caddy = { enable = mkEnableOption "caddy https server"; envFile = mkOption { |
