mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-24 09:54:40 +02:00
service/octoprint: modularize
This commit is contained in:
parent
9cf7be677d
commit
29c8b6e3b1
4 changed files with 35 additions and 17 deletions
|
@ -1,15 +0,0 @@
|
||||||
{ config, pkgs, ... }:
|
|
||||||
{
|
|
||||||
services.octoprint = {
|
|
||||||
enable = true;
|
|
||||||
plugins = plugins: with plugins; [
|
|
||||||
costestimation
|
|
||||||
displayprogress
|
|
||||||
m86motorsoff
|
|
||||||
stlviewer
|
|
||||||
telegram
|
|
||||||
titlestatus
|
|
||||||
];
|
|
||||||
};
|
|
||||||
networking.firewall.allowedTCPPorts = [ 5000 ];
|
|
||||||
}
|
|
|
@ -7,7 +7,6 @@
|
||||||
./services.nix
|
./services.nix
|
||||||
./syncthing.nix
|
./syncthing.nix
|
||||||
./wifi.nix
|
./wifi.nix
|
||||||
#../../legacy/modules/3d-printer.nix
|
|
||||||
../../legacy/modules/avahi.nix
|
../../legacy/modules/avahi.nix
|
||||||
../../legacy/modules/docker.nix
|
../../legacy/modules/docker.nix
|
||||||
../../legacy/modules/nix.nix
|
../../legacy/modules/nix.nix
|
||||||
|
|
|
@ -12,8 +12,9 @@
|
||||||
./navidrome
|
./navidrome
|
||||||
./nextcloud
|
./nextcloud
|
||||||
./nginx
|
./nginx
|
||||||
./passworts
|
./octoprint
|
||||||
./paperless
|
./paperless
|
||||||
|
./passworts
|
||||||
./rss-bridge
|
./rss-bridge
|
||||||
./ssh-server
|
./ssh-server
|
||||||
];
|
];
|
||||||
|
|
33
modules/services/octoprint/default.nix
Normal file
33
modules/services/octoprint/default.nix
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
# 3d-printing software
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.services.minecraft-server;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.services.octoprint = with lib; {
|
||||||
|
enable = mkEnableOption "Octoprint Server";
|
||||||
|
|
||||||
|
plugins = mkOption {
|
||||||
|
type = types.functionTo (types.listOf types.package);
|
||||||
|
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.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.octoprint = {
|
||||||
|
enable = true;
|
||||||
|
plugins = plugins: with plugins; [
|
||||||
|
costestimation
|
||||||
|
displayprogress
|
||||||
|
m86motorsoff
|
||||||
|
stlviewer
|
||||||
|
telegram
|
||||||
|
titlestatus
|
||||||
|
];
|
||||||
|
};
|
||||||
|
networking.firewall.allowedTCPPorts = [ 5000 ];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue