Merge pull request #201052 from Stunkymonkey/octoprint-firewall
nixos/octoprint: add openFirewall option
This commit is contained in:
commit
d13437b014
@ -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 ];
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user