Add agenix, spigot-server and ionos-dyndns to gilgamesh config
All checks were successful
Check / Lint Ansible Files (push) Successful in 3m1s
All checks were successful
Check / Lint Ansible Files (push) Successful in 3m1s
This commit is contained in:
parent
e61a07f8d3
commit
f2f12a2688
@ -1,9 +1,16 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
let
|
||||
agenix = builtins.fetchTarball {
|
||||
url = "https://github.com/ryantm/agenix/archive/daf42cb35b2dc614d1551e37f96406e4c4a2d3e4.tar.gz";
|
||||
sha256 = "0gbn01hi8dh7s9rc66yawnmixcasadf20zci4ijzpd143ph492ad";
|
||||
};
|
||||
in {
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
./spigot.nix
|
||||
"${agenix}/modules/age.nix"
|
||||
../modules/spigot-server.nix
|
||||
../modules/ionos-dyndns.nix
|
||||
];
|
||||
|
||||
# Use the GRUB 2 boot loader.
|
||||
@ -77,13 +84,38 @@
|
||||
nssmdns = true;
|
||||
};
|
||||
|
||||
services.spigot = {
|
||||
services.spigot-server = {
|
||||
enable = true;
|
||||
user = "spigot";
|
||||
};
|
||||
|
||||
# Secrets management
|
||||
age.secrets = {
|
||||
ionos-prefix = {
|
||||
file = ../secrets/ionos-prefix.age;
|
||||
owner = "ionos-dyndns";
|
||||
group = "ionos-dyndns";
|
||||
};
|
||||
ionos-secret = {
|
||||
file = ../secrets/ionos-secret.age;
|
||||
owner = "ionos-dyndns";
|
||||
group = "ionos-dyndns";
|
||||
};
|
||||
};
|
||||
|
||||
# DynDNS stuff. IONOS has a (proprietary?) API for this,
|
||||
# so we're using a Python script from the interwebs :shrug:
|
||||
# TODO: Config using agenix
|
||||
services.ionos-dyndns = {
|
||||
enable = true;
|
||||
# Must match the user owning the secrets below. See agenix config
|
||||
# above for more details.
|
||||
user = "ionos-dyndns";
|
||||
apiPrefixPath = config.age.secrets.ionos-prefix.path;
|
||||
apiSecretPath = config.age.secrets.ionos-secret.path;
|
||||
aaaa = true;
|
||||
fqdn = "blocks.beany.club";
|
||||
interface = "enp0s25";
|
||||
};
|
||||
|
||||
# Open ports in the firewall.
|
||||
networking.firewall.allowedTCPPorts = [ 25565 ];
|
||||
|
@ -3,12 +3,11 @@ with lib;
|
||||
let
|
||||
ionos-dyndns = pkgs.callPackage ../packages/ionos-dyndns.nix {};
|
||||
spigot-server = pkgs.callPackage ../packages/spigot-server.nix {};
|
||||
cfg = config.services.spigot;
|
||||
name = "spigot";
|
||||
cfg = config.services.spigot-server;
|
||||
StateDirectory = "spigot-server";
|
||||
in {
|
||||
options = {
|
||||
services.spigot = {
|
||||
services.spigot-server = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
@ -19,7 +18,7 @@ in {
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = name;
|
||||
default = "spigot-server";
|
||||
description = ''
|
||||
The user account and group that Spigot runs as.
|
||||
'';
|
||||
@ -29,14 +28,14 @@ in {
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
users.users = {
|
||||
${name} = {
|
||||
${cfg.user} = {
|
||||
isSystemUser = true;
|
||||
group = name;
|
||||
group = cfg.user;
|
||||
description = "Spigot Minecraft server user";
|
||||
};
|
||||
};
|
||||
users.groups = {
|
||||
${name} = {
|
||||
${cfg.user} = {
|
||||
};
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user