From 186e4971c9c76bafabd5badc1a14ad4d66a89b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 11 Apr 2023 00:23:59 +0200 Subject: [PATCH] Cleanup --- flake.nix | 14 ++++----- hosts/pulsebert/default.nix | 57 ++++++++++++------------------------- hosts/riscbert/default.nix | 3 +- 3 files changed, 27 insertions(+), 47 deletions(-) diff --git a/flake.nix b/flake.nix index 5cd61e45..c1a5a3a8 100644 --- a/flake.nix +++ b/flake.nix @@ -219,7 +219,7 @@ }; }; - outputs = inputs@{ self, alert2muc, c3d2-user-module, deployment, fenix, harmonia, heliwatch, microvm, naersk, nixos, nixos-hardware, nixos-modules, buzzrelay, caveman, oparl-scraper, scrapers, secrets, skyflake, sshlogd, sops-nix, spacemsg, ticker, tigger, yammat, zentralwerk, ... }: + outputs = inputs@{ self, alert2muc, c3d2-user-module, deployment, harmonia, heliwatch, microvm, nixos, nixos-hardware, nixos-modules, buzzrelay, caveman, oparl-scraper, scrapers, secrets, skyflake, sshlogd, sops-nix, spacemsg, ticker, tigger, yammat, zentralwerk, ... }: let inherit (nixos) lib; @@ -245,9 +245,9 @@ lib.recursiveUpdate result (extractZwHosts zentralwerk.lib.config.site.net."${net}") ) {} [ "core" "cluster" "c3d2" "serv" "flpk" "pub" ]; - overlayList = [ - self.overlays - ]; + overlayList = [ + self.overlays + ]; # Our custom NixOS builder nixosSystem' = @@ -285,8 +285,6 @@ legacyPackages = lib.attrsets.mapAttrs (_: pkgs: pkgs.appendOverlays overlayList) nixos.legacyPackages; - lib = { inherit hostRegistry; }; - packages = import ./packages.nix { inherit hostRegistry inputs lib microvm self; }; nixosConfigurations = { @@ -441,7 +439,9 @@ { nixpkgs.overlays = [ (final: prev: with final; { - harmonia = harmonia.packages.${system}.harmonia.override { pkgs = prev // { rustPlatform = rustPackages_1_66.rustPlatform; }; }; + harmonia = harmonia.packages.${system}.harmonia.override { + pkgs = prev // { inherit (rustPackages_1_66) rustPlatform; }; + }; }) ]; } diff --git a/hosts/pulsebert/default.nix b/hosts/pulsebert/default.nix index 2c63c40c..b8943cf0 100644 --- a/hosts/pulsebert/default.nix +++ b/hosts/pulsebert/default.nix @@ -128,13 +128,10 @@ }; }; - users.users = lib.mkMerge [ - (lib.optionalAttrs config.services.octoprint.enable { - # Allow access to printer serial port and GPIO - "${config.services.octoprint.user}".extraGroups = [ "dialout" ]; - }) - { } - ]; + users.users = lib.optionalAttrs config.services.octoprint.enable { + # Allow access to printer serial port and GPIO + "${config.services.octoprint.user}".extraGroups = [ "dialout" ]; + }; services = { # Do not log to flash but also breaks journalctl --user @@ -160,46 +157,28 @@ extraConfig = '' proxy_set_header X-Scheme $scheme; proxy_set_header Accept-Encoding identity; - client_max_body_size 2000M; + client_max_body_size 200M; ''; }; - locations."/cam/stream" = { - proxyPass = "http://localhost:3020/?action=stream"; - extraConfig = "proxy_pass_request_headers off;"; - }; - locations."/cam/capture" = { - proxyPass = "http://localhost:3020/?action=snapshot"; - extraConfig = "proxy_pass_request_headers off;"; - }; + # locations."/cam/stream" = { + # proxyPass = "http://localhost:3020/?action=stream"; + # extraConfig = "proxy_pass_request_headers off;"; + # }; + # locations."/cam/capture" = { + # proxyPass = "http://localhost:3020/?action=snapshot"; + # extraConfig = "proxy_pass_request_headers off;"; + # }; }; }; }; - octoprint = rec { + octoprint = { enable = true; port = 8080; - extraConfig.webcam = { - snapshot = "http://localhost:3020?action=snapshot"; - stream = "https://drkkr.hq.c3d2.de/cam/stream"; - }; - # plugins = let - # python = pkgs.octoprint.python; - - # octoprint-filament-sensor-universal = python.pkgs.buildPythonPackage rec { - # pname = "OctoPrint-Filament-Sensor-Universal"; - # version = "1.0.0"; - - # src = pkgs.fetchFromGitHub { - # owner = "lopsided98"; - # repo = pname; - # rev = "8a72696867a9a008c5a79b49a9b029a4fc426720"; - # sha256 = "1a7lzmjbwx47qhrkjp3hggiwnx172x4axcz0labm9by17zxlsimr"; - # }; - - # propagatedBuildInputs = [ pkgs.octoprint python.pkgs.libgpiod ]; - # }; - # #in p: [ octoprint-filament-sensor-universal ]; - # in p: []; + # extraConfig.webcam = { + # snapshot = "http://localhost:3020?action=snapshot"; + # stream = "https://drkkr.hq.c3d2.de/cam/stream"; + # }; }; }; diff --git a/hosts/riscbert/default.nix b/hosts/riscbert/default.nix index 2a351f88..3ef11e80 100644 --- a/hosts/riscbert/default.nix +++ b/hosts/riscbert/default.nix @@ -1,4 +1,5 @@ -{ hostRegistry, config, lib, pkgs, ... }: +{ config, hostRegistry, lib, pkgs, ... }: + { networking.hostName = "riscbert";