70 lines
No EOL
1.1 KiB
Nix
70 lines
No EOL
1.1 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
with lib;
|
|
let
|
|
cfg = config.services.skynet_games;
|
|
in {
|
|
imports = [
|
|
./dns.nix
|
|
|
|
./games/minecraft.nix
|
|
];
|
|
|
|
|
|
options.services.skynet_games = {
|
|
enable = mkEnableOption "Skynet Games";
|
|
|
|
host = {
|
|
ip = mkOption {
|
|
type = types.str;
|
|
};
|
|
|
|
name = mkOption {
|
|
type = types.str;
|
|
};
|
|
};
|
|
|
|
domain = {
|
|
tld = mkOption {
|
|
type = types.str;
|
|
default = "ie";
|
|
};
|
|
|
|
base = mkOption {
|
|
type = types.str;
|
|
default = "skynet";
|
|
};
|
|
|
|
sub = mkOption {
|
|
type = types.str;
|
|
default = "games";
|
|
};
|
|
};
|
|
|
|
};
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
skynet_dns.records = {
|
|
cname = [
|
|
# need a base domain
|
|
"${cfg.domain.sub} CNAME ${cfg.host.name}"
|
|
];
|
|
};
|
|
|
|
# the minecraft servers
|
|
services.skynet_games_minecraft = {
|
|
enable = true;
|
|
|
|
host = {
|
|
ip = cfg.host.ip;
|
|
name = cfg.domain.sub;
|
|
};
|
|
|
|
domain = {
|
|
sub = "minecraft.${cfg.domain.sub}";
|
|
};
|
|
};
|
|
|
|
|
|
};
|
|
} |