From 99994a67b167b7f698a974d1becfa55feabf9b0f Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Sun, 27 Nov 2022 23:35:12 +0100 Subject: [PATCH 1/5] Fix shutdown units --- hosts/droppie/restic-backup.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hosts/droppie/restic-backup.nix b/hosts/droppie/restic-backup.nix index d3732c21..c449366c 100644 --- a/hosts/droppie/restic-backup.nix +++ b/hosts/droppie/restic-backup.nix @@ -2,7 +2,7 @@ let shutdownWaitMinutes = 15; - shutdownScript = pkgs.writeScript "shutdown" '' + shutdownScript = pkgs.writeShellScriptBin "shutdown-wait" '' STATUS_FILES="/media/internal/backups-pub-solar/status" running="" @@ -37,7 +37,8 @@ in systemd.services."shutdown-after-backup" = { enable = true; serviceConfig = { - ExecStart = shutdownScript; + ExecStart = "${shutdownScript}/bin/shutdown-wait"; + Type = "oneshot"; }; }; @@ -47,5 +48,6 @@ in OnCalendar = "3..9:*"; }; wantedBy = [ "timers.target" ]; + partOf = [ "shutdown-after-backup.service" ]; }; } From 3960ae45c92036f79dc844a5d5154b518a30d1b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Mon, 28 Nov 2022 11:39:21 +0100 Subject: [PATCH 2/5] update factorio settings --- hosts/chocolatebar/factorio/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hosts/chocolatebar/factorio/default.nix b/hosts/chocolatebar/factorio/default.nix index 4c818bec..d470d152 100644 --- a/hosts/chocolatebar/factorio/default.nix +++ b/hosts/chocolatebar/factorio/default.nix @@ -22,6 +22,7 @@ in enable = true; port = 34197; # The default, but make it explicit lan = true; + game-password = "pls-dont-grief"; admins = [ "doubtwriter" "kattykat" @@ -30,9 +31,13 @@ in autosave-interval = 3; game-name = "Babes plays v2"; requireUserVerification = false; + bind = "::"; mods = [ far-reach ]; }; + + networking.firewall.allowedUDPPorts = [ 34197 ]; + networking.firewall.allowedTCPPorts = [ 34197 ]; }; } From 12ebe35ece94b90b17bdc46156d8882ae13b46d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Mon, 28 Nov 2022 11:39:28 +0100 Subject: [PATCH 3/5] Update paperless --- hosts/chocolatebar/chocolatebar.nix | 1 + modules/core/networking.nix | 27 +++++++++++++++++++++------ modules/paperless/default.nix | 8 ++++---- users/ben/default.nix | 5 ++++- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/hosts/chocolatebar/chocolatebar.nix b/hosts/chocolatebar/chocolatebar.nix index bb13dce9..28be767e 100644 --- a/hosts/chocolatebar/chocolatebar.nix +++ b/hosts/chocolatebar/chocolatebar.nix @@ -29,6 +29,7 @@ in wayvnc drone-docker-runner stdenv.cc.cc.lib + pkgs.hplip ]; age.secrets."vnc-key.pem" = { diff --git a/modules/core/networking.nix b/modules/core/networking.nix index c5ec9cbe..5d66bc56 100644 --- a/modules/core/networking.nix +++ b/modules/core/networking.nix @@ -43,12 +43,18 @@ in nix.binaryCachePublicKeys = cfg.publicKeys; # These entries get added to /etc/hosts - networking.hosts = { - "127.0.0.1" = [ ] - ++ lib.optionals cfg.enableCaddy [ "caddy.local" ] - ++ lib.optionals config.pub-solar.printing.enable [ "cups.local" ] - ++ lib.optionals cfg.enableHelp [ "help.local" ]; - }; + networking.hosts = + let + hostnames = [ ] + ++ lib.optionals cfg.enableCaddy [ "caddy.local" ] + ++ lib.optionals config.pub-solar.printing.enable [ "cups.local" ] + ++ lib.optionals config.pub-solar.paperless.enable [ "paperless.local" ] + ++ lib.optionals cfg.enableHelp [ "help.local" ]; + in + { + "127.0.0.1" = hostnames; + "::1" = hostnames; + }; # Caddy reverse proxy for local services like cups services.caddy = { @@ -67,6 +73,15 @@ in } '') + (lib.optionalString + config.pub-solar.paperless.enable + '' + paperless.local:80 { + request_header Host localhost:28981 + reverse_proxy localhost:28981 + } + '') + (lib.optionalString cfg.enableHelp '' diff --git a/modules/paperless/default.nix b/modules/paperless/default.nix index 9fd22ab4..d8b1edda 100644 --- a/modules/paperless/default.nix +++ b/modules/paperless/default.nix @@ -23,15 +23,15 @@ in }; config = mkIf cfg.enable { - services.paperless-ng = { + services.paperless = { enable = true; + user = psCfg.user.name; consumptionDir = cfg.consumptionDir; extraConfig = { PAPERLESS_OCR_LANGUAGE = cfg.ocrLanguage; + PAPERLESS_ADMIN_USER = psCfg.user.name; + PAPERLESS_AUTO_LOGIN_USERNAME = psCfg.user.name; }; }; - environment.systemPackages = [ - pkgs.hplip - ]; }; } diff --git a/users/ben/default.nix b/users/ben/default.nix index ce609813..1cb6f5d7 100644 --- a/users/ben/default.nix +++ b/users/ben/default.nix @@ -30,7 +30,10 @@ in ]; }; - paperless.enable = true; + paperless = { + enable = false; + ocrLanguage = "nld+deu"; + }; arduino.enable = true; email.enable = true; uhk.enable = true; From 371e398aeb780b134bf89de1782ebefa27d3d6b8 Mon Sep 17 00:00:00 2001 From: Hendrik Sokolowski Date: Tue, 6 Dec 2022 12:30:59 +0100 Subject: [PATCH 4/5] start on UTC --- hosts/droppie/restic-backup.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/droppie/restic-backup.nix b/hosts/droppie/restic-backup.nix index c449366c..70a1f0e5 100644 --- a/hosts/droppie/restic-backup.nix +++ b/hosts/droppie/restic-backup.nix @@ -45,7 +45,7 @@ in systemd.timers."shutdown-after-backup" = { enable = true; timerConfig = { - OnCalendar = "3..9:*"; + OnCalendar = "3..9:* Etc/UTC"; }; wantedBy = [ "timers.target" ]; partOf = [ "shutdown-after-backup.service" ]; From d47b5972221a8a8b6b9c3ab604a81c8063a27fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Tue, 6 Dec 2022 20:09:25 +0100 Subject: [PATCH 5/5] Add inkscape --- users/ben/home.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/users/ben/home.nix b/users/ben/home.nix index 8590f340..2b84a1bf 100644 --- a/users/ben/home.nix +++ b/users/ben/home.nix @@ -11,6 +11,7 @@ in home-manager = pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] { home.packages = with pkgs; [ + inkscape nix-output-monitor tigervnc dogecoin