2023-09-17 19:51:08 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.services.skynet_games;
|
|
|
|
in {
|
2023-04-25 23:24:54 +00:00
|
|
|
imports = [
|
2023-05-24 15:39:02 +00:00
|
|
|
./dns.nix
|
2023-08-06 19:53:04 +00:00
|
|
|
|
2023-04-25 23:24:54 +00:00
|
|
|
./games/minecraft.nix
|
|
|
|
];
|
2023-05-24 15:39:02 +00:00
|
|
|
|
|
|
|
options.services.skynet_games = {
|
2023-09-17 19:51:08 +00:00
|
|
|
enable = mkEnableOption "Skynet Games";
|
2023-05-24 15:39:02 +00:00
|
|
|
|
2023-09-17 19:51:08 +00:00
|
|
|
host = {
|
|
|
|
ip = mkOption {
|
|
|
|
type = types.str;
|
2023-05-24 15:39:02 +00:00
|
|
|
};
|
|
|
|
|
2023-09-17 19:51:08 +00:00
|
|
|
name = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
};
|
|
|
|
};
|
2023-05-24 15:39:02 +00:00
|
|
|
|
2023-09-17 19:51:08 +00:00
|
|
|
domain = {
|
|
|
|
tld = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "ie";
|
|
|
|
};
|
2023-05-24 15:39:02 +00:00
|
|
|
|
2023-09-17 19:51:08 +00:00
|
|
|
base = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "skynet";
|
2023-05-24 15:39:02 +00:00
|
|
|
};
|
|
|
|
|
2023-09-17 19:51:08 +00:00
|
|
|
sub = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "games";
|
|
|
|
};
|
|
|
|
};
|
2023-05-24 15:39:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2023-07-16 00:53:21 +00:00
|
|
|
skynet_dns.records = [
|
|
|
|
# need a base domain
|
2023-09-17 19:51:08 +00:00
|
|
|
{
|
|
|
|
record = cfg.domain.sub;
|
|
|
|
r_type = "CNAME";
|
|
|
|
value = cfg.host.name;
|
|
|
|
}
|
2023-07-16 00:53:21 +00:00
|
|
|
];
|
2023-05-24 15:39:02 +00:00
|
|
|
|
|
|
|
# the minecraft servers
|
|
|
|
services.skynet_games_minecraft = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
host = {
|
|
|
|
ip = cfg.host.ip;
|
|
|
|
name = cfg.domain.sub;
|
|
|
|
};
|
|
|
|
|
|
|
|
domain = {
|
|
|
|
sub = "minecraft.${cfg.domain.sub}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-09-17 19:51:08 +00:00
|
|
|
}
|