Merge pull request #155295 from InternetUnexplorer/nix-serve-open-firewall

nixos/nix-serve: add openFirewall option
This commit is contained in:
pennae 2022-01-18 09:36:12 +00:00 committed by GitHub
commit 42d6774dc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,6 +26,12 @@ in
'';
};
openFirewall = mkOption {
type = types.bool;
default = false;
description = "Open ports in the firewall for nix-serve.";
};
secretKeyFile = mkOption {
type = types.nullOr types.str;
default = null;
@ -77,5 +83,9 @@ in
"NIX_SECRET_KEY_FILE:${cfg.secretKeyFile}";
};
};
networking.firewall = mkIf cfg.openFirewall {
allowedTCPPorts = [ cfg.port ];
};
};
}