From 51c5578840e7b5f0f87aa67e1249d98870565c53 Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Tue, 20 Aug 2024 01:03:49 +0100 Subject: [PATCH] nixos/stream: Add OctoPrint --- nixos/boxes/home/stream.nix | 32 ++++++++++++++++++++++++++++++++ nixos/modules/tmproot.nix | 1 + 2 files changed, 33 insertions(+) diff --git a/nixos/boxes/home/stream.nix b/nixos/boxes/home/stream.nix index 3d7b309..394cda2 100644 --- a/nixos/boxes/home/stream.nix +++ b/nixos/boxes/home/stream.nix @@ -43,6 +43,38 @@ }; }; + services = { + mjpg-streamer = { + enable = true; + inputPlugin = "input_uvc.so"; + outputPlugin = "output_http.so -w @www@ -n -p 5050"; + }; + octoprint = { + enable = true; + host = "::"; + extraConfig = { + plugins = { + classicwebcam = { + snapshot = "http://${config.networking.fqdn}:5050/?action=snapshot"; + stream = "http://${config.networking.fqdn}:5050/?action=stream"; + streamRatio = "4:3"; + }; + }; + serial = { + port = "/dev/ttyACM0"; + baudrate = 115200; + }; + temperature.profiles = [ + { + bed = 60; + extruder = 215; + name = "PLA"; + } + ]; + }; + }; + }; + systemd.network = { netdevs = { "25-lan" = { diff --git a/nixos/modules/tmproot.nix b/nixos/modules/tmproot.nix index e8a5c8a..352efdf 100644 --- a/nixos/modules/tmproot.nix +++ b/nixos/modules/tmproot.nix @@ -539,6 +539,7 @@ in } ]; }) + (persistSimpleSvc "octoprint") ])) ]);