nixos/octoprint: add openFirewall option

This commit is contained in:
Felix Buehler
2022-12-01 17:38:08 +01:00
parent 40b71c3e93
commit 6de9ec5969
+10 -4
View File
@@ -17,7 +17,7 @@ let
cfgUpdate = pkgs.writeText "octoprint-config.yaml" (builtins.toJSON fullConfig);
pluginsEnv = package.python.withPackages (ps: [ps.octoprint] ++ (cfg.plugins ps));
pluginsEnv = package.python.withPackages (ps: [ ps.octoprint ] ++ (cfg.plugins ps));
package = pkgs.octoprint;
@@ -47,6 +47,12 @@ in
'';
};
openFirewall = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc "Open ports in the firewall for OctoPrint.";
};
user = mkOption {
type = types.str;
default = "octoprint";
@@ -67,7 +73,7 @@ in
plugins = mkOption {
type = types.functionTo (types.listOf types.package);
default = plugins: [];
default = plugins: [ ];
defaultText = literalExpression "plugins: []";
example = literalExpression "plugins: with plugins; [ themeify stlviewer ]";
description = lib.mdDoc "Additional plugins to be used. Available plugins are passed through the plugins input.";
@@ -75,7 +81,7 @@ in
extraConfig = mkOption {
type = types.attrs;
default = {};
default = { };
description = lib.mdDoc "Extra options which are added to OctoPrint's YAML configuration file.";
};
@@ -128,6 +134,6 @@ in
};
};
networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ cfg.port ];
};
}