chore: fmt, feat(syncthing): allow on tailscale

This commit is contained in:
Kat Inskip 2024-09-02 23:17:24 -07:00
parent b7f5cd0562
commit b556db56cc
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
7 changed files with 89 additions and 65 deletions

View file

@ -78,7 +78,8 @@ in {
};
config.networking.firewall.allowedTCPPorts = let
inherit (nginx.virtualHosts.kitchencam) listen';
in mkIf listen'.stream.enable [
in
mkIf listen'.stream.enable [
listen'.stream.port
];
}

View file

@ -1,4 +1,10 @@
{ config, access, gensokyo-zone, lib, ... }: let
{
config,
access,
gensokyo-zone,
lib,
...
}: let
inherit (gensokyo-zone.lib) domain;
inherit (lib.modules) mkIf mkDefault mkForce;
inherit (lib.strings) removePrefix;
@ -22,8 +28,9 @@ in {
serviceName = "moonraker";
scheme = "";
};
in mkForce {
servers.${moonraker} = { };
in
mkForce {
servers.${moonraker} = {};
};
virtualHosts = {
${cfg.hostName} = {
@ -32,7 +39,7 @@ in {
${serverName} = {
# https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/web-apps/fluidd.nix
# XXX: non-@ host required for gatus to work
serverAliases = [ (removePrefix "@" serverName) ];
serverAliases = [(removePrefix "@" serverName)];
proxied.enable = true;
# TODO: proxy.upstream = "fluidd-apiserver";
proxy.url = "http://fluidd-apiserver";

View file

@ -1,4 +1,9 @@
{ config, gensokyo-zone, lib, ... }: let
{
config,
gensokyo-zone,
lib,
...
}: let
inherit (gensokyo-zone.lib) mkAlmostOptionDefault;
inherit (lib.modules) mkIf mkDefault;
inherit (config.services) moonraker octoprint;

View file

@ -1,9 +1,15 @@
{ config, access, gensokyo-zone, lib, ... }: let
{
config,
access,
gensokyo-zone,
lib,
...
}: let
inherit (lib.modules) mkIf mkDefault;
inherit (gensokyo-zone.lib) domain;
inherit (config.services) klipper;
cfg = config.services.moonraker;
in {
in {
sops.secrets = {
moonraker_cfg = {
sopsFile = ./secrets/moonraker.yaml;
@ -19,9 +25,9 @@
group = mkDefault klipper.group;
port = 7125; # it's the default but i'm specifying it anyway
settings = {
"include secrets.conf" = { };
octoprint_compat = { };
history = { };
"include secrets.conf" = {};
octoprint_compat = {};
history = {};
"webcam printer" = let
inherit (config.services.motion.cameras) printercam;
inherit (printercam.settings) camera_id;
@ -46,7 +52,7 @@
trusted_clients =
access.cidrForNetwork.allLocal.all
# XXX: only safe when protected behind vouch!
++ [ "0.0.0.0/0" "::/0" ];
++ ["0.0.0.0/0" "::/0"];
};
machine = {
# disable all machine control

View file

@ -5,5 +5,10 @@
openDefaultPorts = true;
dataDir = "/mnt/kyuuto-litterbox";
};
networking.firewall.interfaces.local.allowedTCPPorts = [ 8384 ];
networking.firewall.interfaces = let
x.allowedTCPPorts = [8384];
in {
local = x;
tail = x;
};
}

View file

@ -1,11 +1,11 @@
{ stdenv
, lib
, fetchFromGitHub
, python3
, unstableGitUpdater
, makeWrapper
{
stdenv,
lib,
fetchFromGitHub,
python3,
unstableGitUpdater,
makeWrapper,
}:
stdenv.mkDerivation rec {
pname = "klipper";
version = "0.12.0-unstable-2024-07-05";
@ -21,11 +21,11 @@ stdenv.mkDerivation rec {
# NB: This is needed for the postBuild step
nativeBuildInputs = [
(python3.withPackages ( p: with p; [ cffi ] ))
(python3.withPackages (p: with p; [cffi]))
makeWrapper
];
buildInputs = [ (python3.withPackages (p: with p; [ can cffi pyserial greenlet jinja2 markupsafe numpy ])) ];
buildInputs = [(python3.withPackages (p: with p; [can cffi pyserial greenlet jinja2 markupsafe numpy]))];
# we need to run this to prebuild the chelper.
postBuild = ''
@ -76,9 +76,8 @@ stdenv.mkDerivation rec {
description = "Klipper 3D printer firmware";
mainProgram = "klippy";
homepage = "https://github.com/KevinOConnor/klipper";
maintainers = with maintainers; [ lovesegfault zhaofengli cab404 ];
maintainers = with maintainers; [lovesegfault zhaofengli cab404];
platforms = platforms.linux;
license = licenses.gpl3Only;
};
}

View file

@ -1,13 +1,14 @@
{
buildPythonApplication
, fetchFromGitHub
, poetry-core
, pyserial
, pillow
, click
buildPythonApplication,
fetchFromGitHub,
poetry-core,
pyserial,
pillow,
click,
}: let
mainProgram = "niimprint";
in buildPythonApplication {
in
buildPythonApplication {
pname = "niimprint";
version = "2024_04_05";
@ -40,4 +41,4 @@ in buildPythonApplication {
meta = {
inherit mainProgram;
};
}
}