This commit is contained in:
Sandro - 2023-04-11 00:23:59 +02:00
parent 0b3bce80fd
commit 186e4971c9
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
3 changed files with 27 additions and 47 deletions

View File

@ -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 let
inherit (nixos) lib; inherit (nixos) lib;
@ -285,8 +285,6 @@
legacyPackages = lib.attrsets.mapAttrs (_: pkgs: pkgs.appendOverlays overlayList) nixos.legacyPackages; legacyPackages = lib.attrsets.mapAttrs (_: pkgs: pkgs.appendOverlays overlayList) nixos.legacyPackages;
lib = { inherit hostRegistry; };
packages = import ./packages.nix { inherit hostRegistry inputs lib microvm self; }; packages = import ./packages.nix { inherit hostRegistry inputs lib microvm self; };
nixosConfigurations = { nixosConfigurations = {
@ -441,7 +439,9 @@
{ {
nixpkgs.overlays = [ nixpkgs.overlays = [
(final: prev: with final; { (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; };
};
}) })
]; ];
} }

View File

@ -128,13 +128,10 @@
}; };
}; };
users.users = lib.mkMerge [ users.users = lib.optionalAttrs config.services.octoprint.enable {
(lib.optionalAttrs config.services.octoprint.enable {
# Allow access to printer serial port and GPIO # Allow access to printer serial port and GPIO
"${config.services.octoprint.user}".extraGroups = [ "dialout" ]; "${config.services.octoprint.user}".extraGroups = [ "dialout" ];
}) };
{ }
];
services = { services = {
# Do not log to flash but also breaks journalctl --user # Do not log to flash but also breaks journalctl --user
@ -160,46 +157,28 @@
extraConfig = '' extraConfig = ''
proxy_set_header X-Scheme $scheme; proxy_set_header X-Scheme $scheme;
proxy_set_header Accept-Encoding identity; proxy_set_header Accept-Encoding identity;
client_max_body_size 2000M; client_max_body_size 200M;
''; '';
}; };
locations."/cam/stream" = { # locations."/cam/stream" = {
proxyPass = "http://localhost:3020/?action=stream"; # proxyPass = "http://localhost:3020/?action=stream";
extraConfig = "proxy_pass_request_headers off;"; # extraConfig = "proxy_pass_request_headers off;";
}; # };
locations."/cam/capture" = { # locations."/cam/capture" = {
proxyPass = "http://localhost:3020/?action=snapshot"; # proxyPass = "http://localhost:3020/?action=snapshot";
extraConfig = "proxy_pass_request_headers off;"; # extraConfig = "proxy_pass_request_headers off;";
}; # };
}; };
}; };
}; };
octoprint = rec { octoprint = {
enable = true; enable = true;
port = 8080; port = 8080;
extraConfig.webcam = { # extraConfig.webcam = {
snapshot = "http://localhost:3020?action=snapshot"; # snapshot = "http://localhost:3020?action=snapshot";
stream = "https://drkkr.hq.c3d2.de/cam/stream"; # 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: [];
}; };
}; };

View File

@ -1,4 +1,5 @@
{ hostRegistry, config, lib, pkgs, ... }: { config, hostRegistry, lib, pkgs, ... }:
{ {
networking.hostName = "riscbert"; networking.hostName = "riscbert";