CrOS/modules/services/octoprint/default.nix
TheWanderingCrow 0c526c0588 add octoprint
2026-02-19 10:00:53 -05:00

26 lines
498 B
Nix

{ config, lib, ... }:
let
port = lib.custom.autoport "octoprint";
in
{
services.caddy.virtualHosts."octoprint.wanderingcrow.net".extraConfig = ''
@auth {
path /caddy-security/*
}
route @auth {
authenticate with myportal
}
route /* {
authorize with octoprint
reverse_proxy http://localhost:${builtins.toString config.services.octoprint.port}
}
'';
services.octoprint = {
inherit port;
enable = true;
openFirewall = true;
};
}