The new NixOS websockify module
modules/services/networking/websockify.nix
tries to set the sslKey option default equal to the sslCert option, which
breaks the man page build if the user has not set it (as sslCert has no
default).
The attached patch is a proposal that fixes the man page build.
diff --git a/modules/services/networking/websockify.nix b/modules/services/networking/websockify.nix
index 5e97d2a..e9cf434 100644
--- a/modules/services/networking/websockify.nix
+++ b/modules/services/networking/websockify.nix
@@ -2,7 +2,9 @@
with pkgs.lib;
-let cfg = config.services.networking.websockify; in {
+let cfg = config.services.networking.websockify;
+ sslKey = if builtins.isNull cfg.sslKey
+ then cfg.sslCert else cfg.sslKey; in {
options = {
services.networking.websockify = {
enable = mkOption {
@@ -20,7 +22,6 @@ let cfg = config.services.networking.websockify; in {
sslKey = mkOption {
description = "Path to the SSL key";
- default = cfg.sslCert;
type = types.path;
};
@@ -33,11 +34,13 @@ let cfg = config.services.networking.websockify; in {
};
config = mkIf cfg.enable {
+ assertions = [ { assertion = isPath cfg.sslCert;
+ message = "sslCert path required."; } ];
systemd.services."websockify@" = {
script = ''
IFS=':' read -a array <<< "$1"
${pkgs.pythonPackages.websockify}/bin/websockify --ssl-only \
- --cert=${cfg.sslCert} --key=${cfg.sslKey} 0.0.0.0:''${array[0]} 0.0.0.0:''${array[1]}
+ --cert=${cfg.sslCert} --key=${sslKey} 0.0.0.0:''${array[0]} 0.0.0.0:''${array[1]}
'';
scriptArgs = "%i";
};
_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev