From 44c7b520fe4efe07ee948ae08398fd84e4c0a890 Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 10 Dec 2020 15:24:45 +0100 Subject: [PATCH 1/6] pulsebert: update to nixos-20.09 + working octoprint --- hosts/pulsebert/configuration.nix | 54 +++++++++++++++++++++++-------- krops.nix | 2 +- 2 files changed, 41 insertions(+), 15 deletions(-) diff --git a/hosts/pulsebert/configuration.nix b/hosts/pulsebert/configuration.nix index 78b6b6d0..cf01abcf 100644 --- a/hosts/pulsebert/configuration.nix +++ b/hosts/pulsebert/configuration.nix @@ -6,7 +6,7 @@ { imports = [ # Include the results of the hardware scan. - ./hardware-configuration.nix + ]; boot.loader.grub.enable = false; @@ -119,27 +119,53 @@ services.avahi = { enable = true; publish.enable = true; + publish.addresses = true; publish.userServices = true; }; - # Enable the X11 windowing system. - # services.xserver.enable = true; - # services.xserver.layout = "us"; - # services.xserver.xkbOptions = "eurosign:e"; + services.octoprint = rec { + enable = true; + port = 80; + # extraConfig.webcam = { + # snapshot = "http://localhost:5050?action=snapshot"; + # stream = "http://octoprint.local:5050?action=stream"; + # }; + # plugins = let + # python = pkgs.octoprint.python; - # Enable touchpad support. - # services.xserver.libinput.enable = true; + # octoprint-filament-sensor-universal = python.pkgs.buildPythonPackage rec { + # pname = "OctoPrint-Filament-Sensor-Universal"; + # version = "1.0.0"; - # Enable the KDE Desktop Environment. - # services.xserver.displayManager.sddm.enable = true; - # services.xserver.desktopManager.plasma5.enable = true; + # src = pkgs.fetchFromGitHub { + # owner = "lopsided98"; + # repo = pname; + # rev = "8a72696867a9a008c5a79b49a9b029a4fc426720"; + # sha256 = "1a7lzmjbwx47qhrkjp3hggiwnx172x4axcz0labm9by17zxlsimr"; + # }; - # Define a user account. Don't forget to set a password with ‘passwd’. - # users.users.jane = { - # isNormalUser = true; - # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + # propagatedBuildInputs = [ pkgs.octoprint python.pkgs.libgpiod ]; + # }; + # #in p: [ octoprint-filament-sensor-universal ]; + # in p: []; + }; + # Allow binding to port 80 + systemd.services.octoprint.serviceConfig.AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ]; + + # Allow access to printer serial port and GPIO + users.users.${config.services.octoprint.user}.extraGroups = [ "dialout" "gpio" ]; + + # services.mjpg-streamer = { + # enable = true; + # inputPlugin = "input_uvc.so -r 1280x720"; # }; + # Allow gpio group to access GPIO devices + users.groups.gpio = { }; + services.udev.extraRules = '' + KERNEL=="gpiochip*", GROUP="gpio", MODE="0660" + ''; + # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/krops.nix b/krops.nix index 124ee6d4..2b7c132b 100644 --- a/krops.nix +++ b/krops.nix @@ -40,7 +40,7 @@ in { }; }; pulsebert = pkgs.krops.writeDeploy "pulsebert" { - source = hostSource "pulsebert" "nixos-unstable"; + source = hostSource "pulsebert" "nixos-20.09"; target = lib.mkTarget "k-ot@pulsebert.hq.c3d2.de" // { sudo = true; }; From 3379116fc9bedd14fd886bb5dedd793be9b0a84d Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 10 Dec 2020 15:28:11 +0100 Subject: [PATCH 2/6] public-access-proxy: fix error.hq.c3d2.de.de domain --- hosts/containers/public-access-proxy/configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/containers/public-access-proxy/configuration.nix b/hosts/containers/public-access-proxy/configuration.nix index e0a8a7b1..8d75a5c1 100644 --- a/hosts/containers/public-access-proxy/configuration.nix +++ b/hosts/containers/public-access-proxy/configuration.nix @@ -43,7 +43,7 @@ proxyTo = { host = "172.22.99.170"; httpPort = 80; httpsPort = 443; }; } { - hostNames = [ "error.hq.c3d2.de.de" ]; + hostNames = [ "error.hq.c3d2.de" ]; proxyTo = { host = "172.20.73.47"; httpPort = 80; httpsPort = 443; }; } ]; From f4632a422c6b8483df91d18724c8c027f4929874 Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 10 Dec 2020 15:28:25 +0100 Subject: [PATCH 3/6] pulsebert-access-proxy: add drkkr.hq.c3d2.de --- hosts/containers/public-access-proxy/configuration.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hosts/containers/public-access-proxy/configuration.nix b/hosts/containers/public-access-proxy/configuration.nix index 8d75a5c1..0969c7e5 100644 --- a/hosts/containers/public-access-proxy/configuration.nix +++ b/hosts/containers/public-access-proxy/configuration.nix @@ -46,6 +46,11 @@ hostNames = [ "error.hq.c3d2.de" ]; proxyTo = { host = "172.20.73.47"; httpPort = 80; httpsPort = 443; }; } + { + hostNames = [ "drkkr.hq.c3d2.de" ]; + # pulsebert + proxyTo = { host = "172.22.99.208"; httpPort = 80; httpsPort = 443; }; + } ]; }; From 6048ea42f151c60230e1edaa033688d29a4d7e07 Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 10 Dec 2020 17:26:47 +0100 Subject: [PATCH 4/6] pulsebert: serve drkkr.hq.c3d2.de --- hosts/pulsebert/configuration.nix | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/hosts/pulsebert/configuration.nix b/hosts/pulsebert/configuration.nix index cf01abcf..503a5224 100644 --- a/hosts/pulsebert/configuration.nix +++ b/hosts/pulsebert/configuration.nix @@ -4,6 +4,9 @@ { config, pkgs, ... }: +let + octoprintPort = 8080; +in { imports = [ # Include the results of the hardware scan. @@ -123,9 +126,33 @@ publish.userServices = true; }; + security.acme = { + acceptTerms = true; + email = "mail@c3d2.de"; + }; + services.nginx = { + enable = true; + #recommendedGzipSettings = true; + recommendedProxySettings = true; + virtualHosts = { + "drkkr.hq.c3d2.de" = { + default = true; + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:${toString octoprintPort}"; + proxyWebsockets = true; + extraConfig = '' + proxy_set_header X-Scheme $scheme; + proxy_set_header Accept-Encoding identity; + ''; + }; + }; + }; + }; services.octoprint = rec { enable = true; - port = 80; + port = octoprintPort; # extraConfig.webcam = { # snapshot = "http://localhost:5050?action=snapshot"; # stream = "http://octoprint.local:5050?action=stream"; @@ -149,8 +176,6 @@ # #in p: [ octoprint-filament-sensor-universal ]; # in p: []; }; - # Allow binding to port 80 - systemd.services.octoprint.serviceConfig.AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ]; # Allow access to printer serial port and GPIO users.users.${config.services.octoprint.user}.extraGroups = [ "dialout" "gpio" ]; From af06036cc388decdc0b92e0923bec6e09581b988 Mon Sep 17 00:00:00 2001 From: Astro Date: Fri, 11 Dec 2020 01:35:56 +0100 Subject: [PATCH 5/6] public-access-proxy: rm drkkr.hq.c3d2.de haproxy breaks the websockets --- hosts/containers/public-access-proxy/configuration.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/hosts/containers/public-access-proxy/configuration.nix b/hosts/containers/public-access-proxy/configuration.nix index 0969c7e5..8d75a5c1 100644 --- a/hosts/containers/public-access-proxy/configuration.nix +++ b/hosts/containers/public-access-proxy/configuration.nix @@ -46,11 +46,6 @@ hostNames = [ "error.hq.c3d2.de" ]; proxyTo = { host = "172.20.73.47"; httpPort = 80; httpsPort = 443; }; } - { - hostNames = [ "drkkr.hq.c3d2.de" ]; - # pulsebert - proxyTo = { host = "172.22.99.208"; httpPort = 80; httpsPort = 443; }; - } ]; }; From 780919c313b9d63d5ac980810026d41dc61e6906 Mon Sep 17 00:00:00 2001 From: Astro Date: Wed, 30 Dec 2020 23:37:32 +0100 Subject: [PATCH 6/6] ticker: add exma feeds --- hosts/inbert-containers/ticker/configuration.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hosts/inbert-containers/ticker/configuration.nix b/hosts/inbert-containers/ticker/configuration.nix index 4afba5c3..c9ff71f2 100644 --- a/hosts/inbert-containers/ticker/configuration.nix +++ b/hosts/inbert-containers/ticker/configuration.nix @@ -77,5 +77,13 @@ in url = "https://dresden.bits-und-baeume.org/termine.ics"; color = "#3FBF3F"; }; + exma-stuta = { + url = "https://www.exmatrikulationsamt.de/ics/v1/stuta.ics"; + color = "#7F7FFF"; + }; + exma-nawa = { + url = "https://www.exmatrikulationsamt.de/ics/v1/nawa.ics"; + color = "#3F3FBF"; + }; }; }