octoprint service: add extraConfig
This commit is contained in:
parent
0ba77c4cbd
commit
4a01f70f8f
@ -6,12 +6,16 @@ let
|
|||||||
|
|
||||||
cfg = config.services.octoprint;
|
cfg = config.services.octoprint;
|
||||||
|
|
||||||
cfgUpdate = pkgs.writeText "octoprint-config.yaml" (builtins.toJSON {
|
baseConfig = {
|
||||||
plugins.cura.cura_engine = "${pkgs.curaengine}/bin/CuraEngine";
|
plugins.cura.cura_engine = "${pkgs.curaengine}/bin/CuraEngine";
|
||||||
server.host = cfg.host;
|
server.host = cfg.host;
|
||||||
server.port = cfg.port;
|
server.port = cfg.port;
|
||||||
webcam.ffmpeg = "${pkgs.ffmpeg}/bin/ffmpeg";
|
webcam.ffmpeg = "${pkgs.ffmpeg}/bin/ffmpeg";
|
||||||
});
|
};
|
||||||
|
|
||||||
|
fullConfig = recursiveUpdate cfg.extraConfig baseConfig;
|
||||||
|
|
||||||
|
cfgUpdate = pkgs.writeText "octoprint-config.yaml" (builtins.toJSON fullConfig);
|
||||||
|
|
||||||
pluginsEnv = pkgs.python.buildEnv.override {
|
pluginsEnv = pkgs.python.buildEnv.override {
|
||||||
extraLibs = cfg.plugins pkgs.octoprint-plugins;
|
extraLibs = cfg.plugins pkgs.octoprint-plugins;
|
||||||
@ -62,13 +66,18 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
plugins = mkOption {
|
plugins = mkOption {
|
||||||
#type = types.functionTo (types.listOf types.package);
|
|
||||||
default = plugins: [];
|
default = plugins: [];
|
||||||
defaultText = "plugins: []";
|
defaultText = "plugins: []";
|
||||||
example = literalExample "plugins: [ m3d-fio ]";
|
example = literalExample "plugins: [ m3d-fio ]";
|
||||||
description = "Additional plugins.";
|
description = "Additional plugins.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extraConfig = mkOption {
|
||||||
|
type = types.attrs;
|
||||||
|
default = {};
|
||||||
|
description = "Extra options which are added to OctoPrint's YAML configuration file.";
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user