From 03c63c07226fd9da59d4534b85d0bbb568f933b7 Mon Sep 17 00:00:00 2001 From: Aubrey Taylor Date: Sun, 22 Dec 2024 01:24:24 -0600 Subject: [PATCH] almost done hopefully --- flake.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 7ea9993..7d62ec0 100644 --- a/flake.nix +++ b/flake.nix @@ -85,9 +85,10 @@ description = "The UDP port to host the server on"; }; proximity = { - type = lib.types.attrs; + type = types.nullOr lib.types.attrs; + default = null; port = lib.mkOption { - type = lib.types.port; + type = types.nullOr lib.types.port; example = 4433; description = "The UDP port to host the proximity chat server on"; }; @@ -99,7 +100,7 @@ keyPath = lib.mkOption { type = lib.types.path; example = "cert.pem"; - description = "The certificate used for encrypting the WebTransport stream"; + description = "The private key used for encrypting the WebTransport stream"; }; }; }; @@ -112,8 +113,8 @@ WorkingDirectory = "${self.packages.${system}.default}"; Type = "simple"; ExecStart = let - proxRes = 5; - in ''${self.packages.${system}.default}/bin/smo-server -t ${toString tcpPort} -u ${toString udpPort}''; + proxRes = if proximity == null then "-p ${proximity.port} --prox-cert ${proximity.certPath} --prox-key ${proximity.keyPath}" else ""; + in ''${self.packages.${system}.default}/bin/smo-server -t ${toString tcpPort} -u ${toString udpPort} ${lib.strings.optionalString enableFaker "--enable-faker"}''; }; }; };