diff --git a/machines/lasting-integrity/default.nix b/machines/lasting-integrity/default.nix index 126cd92b..3aa63f6f 100644 --- a/machines/lasting-integrity/default.nix +++ b/machines/lasting-integrity/default.nix @@ -49,7 +49,10 @@ docker.enable = true; git.enable = true; }; - games.tetris.server = true; + games = { + particles.server = true; + tetris.server = true; + }; services = { matrix.enable = true; nginx = { diff --git a/modules/games/default.nix b/modules/games/default.nix index 3c83f6a4..dd8fbfd7 100644 --- a/modules/games/default.nix +++ b/modules/games/default.nix @@ -4,6 +4,7 @@ imports = [ ./minecraft ./mumble + ./particles ./steam ./teeworlds ./tetris diff --git a/modules/games/particles/default.nix b/modules/games/particles/default.nix new file mode 100644 index 00000000..5621e35e --- /dev/null +++ b/modules/games/particles/default.nix @@ -0,0 +1,24 @@ +{ config, lib, pkgs, ... }: + +let + particles = pkgs.fetchgit { + url = "https://git.zeus.gent/midgard/particles.git"; + sha256 = "0weSBjhSS0XuII5yZXWYUJpPOhetFJKbcsS8WWpodhs="; + }; +in +{ + options.chvp.games.particles.server = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.games.particles.server { + chvp.services.nginx.hosts = [{ + fqdn = "particles.vanpetegem.me"; + options = { + root = "${particles}/public"; + locations."/".index = "index.html"; + }; + }]; + }; +} diff --git a/modules/games/tetris/default.nix b/modules/games/tetris/default.nix index b4602d8e..70de3e9c 100644 --- a/modules/games/tetris/default.nix +++ b/modules/games/tetris/default.nix @@ -1,11 +1,5 @@ { config, lib, pkgs, ... }: -let - particles = pkgs.fetchgit { - url = "https://git.zeus.gent/midgard/particles.git"; - sha256 = "0weSBjhSS0XuII5yZXWYUJpPOhetFJKbcsS8WWpodhs="; - }; -in { options.chvp.games.tetris.server = lib.mkOption { default = false; @@ -13,21 +7,12 @@ in }; config = lib.mkIf config.chvp.games.tetris.server { - chvp.services.nginx.hosts = [ - { - fqdn = "tetris.vanpetegem.me"; - options = { - root = "${pkgs.tetris}"; - locations."/".index = "index.html"; - }; - } - { - fqdn = "particles.vanpetegem.me"; - options = { - root = "${particles}/public"; - locations."/".index = "index.html"; - }; - } - ]; + chvp.services.nginx.hosts = [{ + fqdn = "tetris.vanpetegem.me"; + options = { + root = "${pkgs.tetris}"; + locations."/".index = "index.html"; + }; + }]; }; }