ctucx.git: nixfiles

ctucx' nixfiles

commit a53ecfce6a4827950bfc71f597c39e2fa2271f20
parent 574de6fee7894d569fa11874ddc02f44e1146f23
Author: Leah (ctucx) <git@ctu.cx>
Date: Sun, 3 Dec 2023 19:46:50 +0100

machines/briefkasten/travelynx2fedi: move to machine `trabbi`
8 files changed, 73 insertions(+), 63 deletions(-)
diff --git a/configurations/common/programs/utilities.nix b/configurations/common/programs/utilities.nix
@@ -1,24 +1,17 @@
-{ inputs, currentSystem, pkgs, ... }:
+{ inputs, currentSystem, pkgs, config, ... }:
 
 {
+
   home-manager.users.leah = {
     home = {
       packages = with pkgs; [
         coreutils
         inputs.colmena.packages."${currentSystem}".colmena
-        agenix
-        age
-        bitwarden-cli
 
         wget
         curl
         rsync
 
-        yt-dlp
-        (pkgs.writeShellScriptBin "youtube-dl" ''
-          exec ${pkgs.yt-dlp}/bin/yt-dlp --compat-options youtube-dl "$@"
-        '')
-
         eza
         bat
         ripgrep

@@ -30,8 +23,6 @@
 
         smartmontools
 
-        ocrmypdf
-
         e2fsprogs
         dosfstools
 

@@ -43,8 +34,20 @@
 
         lm_sensors
       ] else [
+      ]) ++ (if config.networking.hostName != "wanderduene" then [
+        agenix
+        age
+
+        bitwarden-cli
+
+        ocrmypdf
         phockup
-      ]);
+
+        yt-dlp
+        (pkgs.writeShellScriptBin "youtube-dl" ''
+          exec ${pkgs.yt-dlp}/bin/yt-dlp --compat-options youtube-dl "$@"
+        '')
+      ] else []);
     };
 
     programs = {
diff --git a/machines/briefkasten/configuration.nix b/machines/briefkasten/configuration.nix
@@ -14,7 +14,6 @@
     # syncthing (and it's backup)
     ./syncthing.nix
 
-
     # fedi server
     ./gotosocial.nix
 

@@ -24,7 +23,6 @@
     ./scanner-sftp.nix
 
     ./websites
-    ./travelynx2fedi.nix
   ];
 
   networking.usePBBUplink = true;

@@ -167,6 +165,14 @@
     '';
   };
 
+  systemd.services.viro-check = {
+    startAt   = "*:0/15";
+    onFailure = [ "email-notify@%i.service" ];
+    script    = ''
+      ${pkgs.curl}/bin/curl -s 'https://onlinetermine.arzt-direkt.com/api/opening?localityIds=&instance=639b0e64db18e24406955d24&terminSucheIdent=130944784281370626&forerunTime=0' | ${pkgs.jq}/bin/jq -e '(.openings | length) == 0'
+    '';
+  };
+
   services = {
     email-notify.enable = true;
     nginx.virtualHosts."${config.networking.fqdn}" = {
diff --git a/machines/briefkasten/travelynx2fedi.nix b/machines/briefkasten/travelynx2fedi.nix
@@ -1,34 +0,0 @@
-{ inputs, pkgs, lib, config, ... }:
-
-{
-
-  dns.zones."ctu.cx".subdomains."travelynx2fedi.home".CNAME = lib.mkIf config.networking.usePBBUplink [ "${config.networking.fqdn}." ];
-
-  age.secrets.travelynx2fedi-env.file    = ./. + "/../../secrets/${config.networking.hostName}/travelynx2fedi-env.age";
-
-  imports = [
-    inputs.travelynx2fedi.nixosModule
-  ];
-
-  services.travelynx2fedi = {
-    enable           = true;
-    environmentFiles = [ config.age.secrets.travelynx2fedi-env.path ];
-
-    config = {
-      server.accessToken = "$TRAVELYNX_TOKEN";
-      travelynx.username = "ctucx";
-      fedi.url           = "\"https://fedi.ctu.cx\"";
-      fedi.accessToken   = "$FEDI_TOKEN";
-      fedi.visibility    = "private";
-      fedi.spoilerText   = "travelynx";
-      fedi.useMarkdown   = "yes";
-    };
-
-    nginx = {
-      enable     = true;
-      enableACME = true;
-      domain     = "travelynx2fedi.home.ctu.cx";
-    };
-  };
-
-}-
\ No newline at end of file
diff --git a/machines/trabbi/configuration.nix b/machines/trabbi/configuration.nix
@@ -29,6 +29,7 @@
 
     # websites
     ./websites
+    ./travelynx2fedi.nix
   ];
 
   networking.primaryIP    = "2a0a:4cc0:1:2d7::1";
diff --git a/machines/trabbi/travelynx2fedi.nix b/machines/trabbi/travelynx2fedi.nix
@@ -0,0 +1,34 @@
+{ inputs, pkgs, lib, config, ... }:
+
+{
+
+  dns.zones."ctu.cx".subdomains."travelynx2fedi".CNAME = [ "${config.networking.fqdn}." ];
+
+  age.secrets.travelynx2fedi-env.file    = ./. + "/../../secrets/${config.networking.hostName}/travelynx2fedi-env.age";
+
+  imports = [
+    inputs.travelynx2fedi.nixosModule
+  ];
+
+  services.travelynx2fedi = {
+    enable           = true;
+    environmentFiles = [ config.age.secrets.travelynx2fedi-env.path ];
+
+    config = {
+      server.accessToken = "$TRAVELYNX_TOKEN";
+      travelynx.username = "ctucx";
+      fedi.url           = "\"https://fedi.ctu.cx\"";
+      fedi.accessToken   = "$FEDI_TOKEN";
+      fedi.visibility    = "private";
+      fedi.spoilerText   = "travelynx";
+      fedi.useMarkdown   = "yes";
+    };
+
+    nginx = {
+      enable     = true;
+      enableACME = true;
+      domain     = "travelynx2fedi.ctu.cx";
+    };
+  };
+
+}+
\ No newline at end of file
diff --git a/secrets/briefkasten/travelynx2fedi-env.age b/secrets/briefkasten/travelynx2fedi-env.age
@@ -1,13 +0,0 @@
------BEGIN AGE ENCRYPTED FILE-----
-YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBySEF4MFZVb2tnLzRuQW8v
-UERpM1BGOFBjODhhQTFwdTBzVWxOSkloT0NZCmNBY3VaS0VqQzZxTVA0MUdYTXlp
-aGh6UlI2anV4N1FhUjRWWVZxOStyd28KLT4gc3NoLWVkMjU1MTkgNGhLQ013IDlj
-Q2Q0cGVoS1FCVnZ4OFl2NXl2bVBsQUFNTHFNaWNZQVo2eUpWRmF5VDQKS1lxUVBO
-bTdSRms5dmI5dGhxTlh5ZEJZYzBnZW0xUDdrNjA5N2x2YlUwQQotPiB8Y0d9fC1n
-cmVhc2UgXDdSem4KYk9Fc1NFMjErLzQ0eEk1VEpGb1FwYkk2N3FSRVVnSi9wemxX
-b0dxNFlRVThxUlQyQlhhQkFRCi0tLSBYc1B0MU9YUnpjN0dERk54NVdUbWRFV3la
-b09mZ1lsUmVndm9KU1ErR05FCi6ONEjU+568qx3K3DiFHlS44aigFg5XkgRHs/cf
-tTaGsGAOOB3g1wQ2TrDd5C6eNFx1zfRdSkse+gYhcosIzO9TIjqwE9+odgCWgqD/
-D+ZR+Ta1W7QGn0U69/V6FotQ50EY8Dxr8O9KVjXAQJIH7b3GrUMDYVe7Ktu8prDG
-eW/cMPNo2ejxRLuyE/GHp6M0CIvvJQJWN1tz3a7UbFUqVSUBMSk=
------END AGE ENCRYPTED FILE-----
diff --git a/secrets/secrets.nix b/secrets/secrets.nix
@@ -51,7 +51,6 @@ in {
   "briefkasten/wireguard-privkey.age".publicKeys                    = [ leah briefkasten ];
 
   "briefkasten/gotosocial-env.age".publicKeys                       = [ leah briefkasten ];
-  "briefkasten/travelynx2fedi-env.age".publicKeys                   = [ leah briefkasten ];
 
   "briefkasten/restic-server-htpasswd.age".publicKeys               = [ leah briefkasten ];
 

@@ -90,6 +89,7 @@ in {
   "trabbi/mail/password-mail-zug.network.age".publicKeys            = [ leah trabbi ];
 
   "trabbi/radicale-users.age".publicKeys                            = [ leah trabbi ];
+  "trabbi/travelynx2fedi-env.age".publicKeys                        = [ leah trabbi ];
 
   "trabbi/vaultwarden-secrets.age".publicKeys                       = [ leah trabbi ];
 
diff --git a/secrets/trabbi/travelynx2fedi-env.age b/secrets/trabbi/travelynx2fedi-env.age
@@ -0,0 +1,13 @@
+-----BEGIN AGE ENCRYPTED FILE-----
+YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBOVFFGSG5IYVJPblJZemds
+VFNoK00vZmZDMHBYOHhzamhzU0JvVGRGZTJRCmhJVVVWYUgzTkdMYUlRY1VhZi9D
+ZHJiSHRseHV2RklsODBxV05Zd0k0VmMKLT4gc3NoLWVkMjU1MTkgVjB1VXJ3IGQ3
+ckN2THNvdWtJbXFYSnQyd3dUWmZSVzI3QUdLM1RhS1lyMzREdTYyRzQKaXpJWHFD
+ZGdMMUJTYU40UjluY0RKQkZMc1MwVWJrelh4RUtlWmRVYjB3awotPiBAPlktZ3Jl
+YXNlIFQ5ZHBvICxlR2tuQz9yClVqNmdHSG9talcxS0FoZU8wWEcvZ1ZycVFLTTZM
+alFuZ1ltTE1wTDYKLS0tIEFWOTF6ZkI2SDFHK3FwdXVNaTBjWDhhcWZuQTFDQlc2
+cC8zTzZqY25lTFUKFe90bgb9T+eKbCp2P96+orgSnGw6Y1V335eu3j/tBPniyc0G
+vz/UiY6S6YZROYD1J5yHXIEjG/TBT8aqJqlu5LFodRNXZ/mAzOw8yyHejageedNY
+EFLz5QftnmsYLOzQpIaL2Cl+2PuiWkk2EXSTgQSUt1t3RbjONC8hNDdHy8MyJFQN
+13V1grjnwDqFpWa14T6ONCJ669vbd3tM89FnbmfA3A==
+-----END AGE ENCRYPTED FILE-----