hopefully it works this time

This commit is contained in:
Aubrey 2024-12-22 01:09:26 -06:00
parent f473e2559f
commit 0cb24a843a
No known key found for this signature in database

View file

@ -55,8 +55,13 @@
formatter = alejandra; formatter = alejandra;
} }
) )
// { // flake-utils.lib.eachDefaultSystemPassThrough (system: {
nixosModules.default = {config, lib, pkgs, system, ...}: { nixosModules.default = {
config,
lib,
pkgs,
...
}: {
options.services.smo-server = { options.services.smo-server = {
enable = lib.mkEnableOption "a game server for Super Mario Odyssey Online"; enable = lib.mkEnableOption "a game server for Super Mario Odyssey Online";
user = lib.mkOption { user = lib.mkOption {
@ -71,19 +76,19 @@
}; };
tcpPort = lib.mkOption { tcpPort = lib.mkOption {
type = lib.types.port; type = lib.types.port;
default = 1027; default = "1027";
description = "The TCP port to host the server on"; description = "The TCP port to host the server on";
}; };
udpPort = lib.mkOption { udpPort = lib.mkOption {
type = lib.types.port; type = lib.types.port;
default = 1027; default = "1027";
description = "The UDP port to host the server on"; description = "The UDP port to host the server on";
}; };
proximity = { proximity = {
type = lib.types.attrs; type = lib.types.attrs;
port = lib.mkOption { port = lib.mkOption {
type = lib.types.port; type = lib.types.port;
example = 4433; example = "4433";
description = "The UDP port to host the proximity chat server on"; description = "The UDP port to host the proximity chat server on";
}; };
certPath = lib.mkOption { certPath = lib.mkOption {
@ -104,14 +109,14 @@
after = ["network.target"]; after = ["network.target"];
description = "Start smo-server"; description = "Start smo-server";
serviceConfig = { serviceConfig = {
WorkingDirectory = "${self.packages.${system}.default.outPath}"; WorkingDirectory = "${self.packages.${system}.default}";
Type = "simple"; Type = "simple";
ExecStart = let ExecStart = let
proxRes = 5; proxRes = 5;
in ''${self.packages.${system}.default.outPath}/bin/smo-server -t ${tcpPort} -u ${udpPort}''; in ''${self.packages.${system}.default}/bin/smo-server -t ${tcpPort} -u ${udpPort}'';
};
}; };
}; };
}; };
}; };
});
} }