mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-10 04:49:19 -08:00
feat(logistics): closer to a working prinper
This commit is contained in:
parent
754fb6a486
commit
17524cc5b8
5 changed files with 43 additions and 0 deletions
36
modules/system/exports/moonraker.nix
Normal file
36
modules/system/exports/moonraker.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
gensokyo-zone,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (gensokyo-zone.lib) mkAlmostOptionDefault;
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
in {
|
||||||
|
config.exports.services.moonraker = {config, ...}: {
|
||||||
|
displayName = mkAlmostOptionDefault "Moonraker";
|
||||||
|
id = mkAlmostOptionDefault "moonraker";
|
||||||
|
nixos = {
|
||||||
|
serviceAttr = "moonraker";
|
||||||
|
assertions = let
|
||||||
|
mkAssertion = f: nixosConfig: let
|
||||||
|
cfg = nixosConfig.services.moonraker;
|
||||||
|
in
|
||||||
|
f nixosConfig cfg;
|
||||||
|
in
|
||||||
|
mkIf config.enable [
|
||||||
|
(mkAssertion (nixosConfig: cfg: {
|
||||||
|
assertion = config.ports.default.port == cfg.port;
|
||||||
|
message = "port mismatch";
|
||||||
|
}))
|
||||||
|
];
|
||||||
|
};
|
||||||
|
defaults.port.listen = mkAlmostOptionDefault "lan";
|
||||||
|
ports = {
|
||||||
|
default = {
|
||||||
|
port = mkAlmostOptionDefault 7125;
|
||||||
|
protocol = "http";
|
||||||
|
status.enable = mkAlmostOptionDefault true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,9 @@ _: {
|
||||||
services = {
|
services = {
|
||||||
klipper = {
|
klipper = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
octoprintIntegration = true;
|
||||||
|
settings = {
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ _: {
|
||||||
moonraker = {
|
moonraker = {
|
||||||
enable = true;
|
enable = true;
|
||||||
address = "0.0.0.0";
|
address = "0.0.0.0";
|
||||||
|
port = 7125; # it's the default but i'm specifying it anyway
|
||||||
settings = {
|
settings = {
|
||||||
octoprint_compat = { };
|
octoprint_compat = { };
|
||||||
history = { };
|
history = { };
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@ _: {
|
||||||
ports.stream.port = 41081;
|
ports.stream.port = 41081;
|
||||||
};
|
};
|
||||||
octoprint.enable = true;
|
octoprint.enable = true;
|
||||||
|
nginx.enable = true;
|
||||||
|
moonraker.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
network.networks = {
|
network.networks = {
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ in {
|
||||||
nixos.cameras.printer
|
nixos.cameras.printer
|
||||||
nixos.cameras.logistics-webcam
|
nixos.cameras.logistics-webcam
|
||||||
nixos.octoprint
|
nixos.octoprint
|
||||||
|
nixos.nginx
|
||||||
nixos.klipper
|
nixos.klipper
|
||||||
nixos.moonraker
|
nixos.moonraker
|
||||||
nixos.fluidd
|
nixos.fluidd
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue