ctucx.git: nixfiles

ctucx' nixfiles

commit 1df7413185e7bd0d4a8ffadcb76a6a0bf0900de5
parent 8456e9d9132456771373dd137b69ead0555c1f3e
Author: Leah (ctucx) <leah@ctu.cx>
Date: Thu, 27 Jan 2022 10:43:42 +0100

services: add restic-server
2 files changed, 30 insertions(+), 30 deletions(-)
A
configurations/services/restic-server.nix
|
30
++++++++++++++++++++++++++++++
D
machines/lollo/restic-server.nix
|
30
------------------------------
diff --git a/configurations/services/restic-server.nix b/configurations/services/restic-server.nix
@@ -0,0 +1,30 @@
+{ config, lib, pkgs, ...}:
+
+{
+
+  services = {
+    restic.server = {
+      enable     = true;
+      appendOnly = true;
+      extraFlags = [ "--no-auth" ];
+      dataDir    = "/var/lib/restic";
+    };
+
+    nginx = {
+      enable = true;
+      virtualHosts."restic.${config.networking.hostName}.${config.networking.domain}" = {
+        enableACME = true;
+        forceSSL   = true;
+        locations."/" = {
+          proxyPass   = "http://127.0.0.1:8000/";
+          extraConfig = ''
+            client_max_body_size 10G;
+            auth_basic           Auth;
+            auth_basic_user_file /var/lib/secrets/restic-auth;
+          '';
+        };
+      };
+    };
+  };
+
+}
diff --git a/machines/lollo/restic-server.nix b/machines/lollo/restic-server.nix
@@ -1,30 +0,0 @@
-{config, lib, pkgs, ...}:
-
-{
-
-  services = {
-    restic.server = {
-      enable     = true;
-      appendOnly = true;
-      extraFlags = [ "--no-auth" ];
-      dataDir    = "/var/lib/restic";
-    };
-
-    nginx = {
-      enable = true;
-      virtualHosts."restic.lollo.ctu.cx" = {
-        enableACME = true;
-        forceSSL   = true;
-        locations."/" = {
-          proxyPass   = "http://127.0.0.1:8000/";
-          extraConfig = ''
-            client_max_body_size 10G;
-            auth_basic           Auth;
-            auth_basic_user_file /var/lib/secrets/restic-auth;
-          '';
-        };
-      };
-    };
-  };
-
-}