feat(logistics): closer to a working prinper

This commit is contained in:
Kat Inskip 2024-08-06 11:47:56 -07:00
parent 754fb6a486
commit 17524cc5b8
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
5 changed files with 43 additions and 0 deletions

View 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;
};
};
};
}

View file

@ -2,6 +2,9 @@ _: {
services = {
klipper = {
enable = true;
octoprintIntegration = true;
settings = {
};
};
};
}

View file

@ -3,6 +3,7 @@ _: {
moonraker = {
enable = true;
address = "0.0.0.0";
port = 7125; # it's the default but i'm specifying it anyway
settings = {
octoprint_compat = { };
history = { };

View file

@ -12,6 +12,8 @@ _: {
ports.stream.port = 41081;
};
octoprint.enable = true;
nginx.enable = true;
moonraker.enable = true;
};
};
network.networks = {

View file

@ -18,6 +18,7 @@ in {
nixos.cameras.printer
nixos.cameras.logistics-webcam
nixos.octoprint
nixos.nginx
nixos.klipper
nixos.moonraker
nixos.fluidd