about summary refs log tree commit diff
path: root/nix/hosts/wildcat/configuration.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix/hosts/wildcat/configuration.nix')
-rw-r--r--nix/hosts/wildcat/configuration.nix32
1 files changed, 24 insertions, 8 deletions
diff --git a/nix/hosts/wildcat/configuration.nix b/nix/hosts/wildcat/configuration.nix
index 884b292..6078bf7 100644
--- a/nix/hosts/wildcat/configuration.nix
+++ b/nix/hosts/wildcat/configuration.nix
@@ -19,7 +19,8 @@
   # TODO(fcuny): I could create the configuration file to set the default branch
   services.gitolite = {
     enable = true;
-    adminPubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINBkozy+X96u5ciX766bJ/AyQ3xm1tXZTIr5+4PVFZFi";
+    adminPubkey =
+      "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINBkozy+X96u5ciX766bJ/AyQ3xm1tXZTIr5+4PVFZFi";
     user = "git";
     group = "git";
     extraGitoliteRc = ''
@@ -46,10 +47,10 @@
       readme = ":README.md";
       project-list = "/var/lib/gitolite/projects.list";
       about-filter = "${pkgs.cgit-pink}/lib/cgit/filters/about-formatting.sh";
-      source-filter = "${pkgs.cgit-pink}/lib/cgit/filters/syntax-highlighting.py";
-      clone-url = (lib.concatStringsSep " " [
-        "https://git.fcuny.net/$CGIT_REPO_URL"
-      ]);
+      source-filter =
+        "${pkgs.cgit-pink}/lib/cgit/filters/syntax-highlighting.py";
+      clone-url =
+        (lib.concatStringsSep " " [ "https://git.fcuny.net/$CGIT_REPO_URL" ]);
       enable-log-filecount = 1;
       enable-log-linecount = 1;
       enable-git-config = 1;
@@ -83,9 +84,7 @@
         forceSSL = true;
         enableACME = true;
         locations = {
-          "/" = {
-            root = "/srv/www/fcuny.net";
-          };
+          "/" = { root = "/srv/www/fcuny.net"; };
           "/.well-known/acme-challenge" = {
             root = "/var/lib/acme/acme-challenges";
           };
@@ -106,4 +105,21 @@
       };
     };
   };
+
+  services.restic.backups.git = {
+    user = "fcuny";
+    passwordFile = "/etc/restic.pw";
+    repository = "/srv/backups/git";
+    initialize = true;
+    paths = [ "/var/lib/gitolite" ];
+    exclude = [ "/var/lib/gitolite/.bash_history" "/var/lib/gitolite/.ssh" ];
+    extraBackupArgs = [ "--exclude-caches" "--compression=max" ];
+    timerConfig = { OnCalendar = "*:0/30"; };
+    pruneOpts = [
+      "--keep-hourly 36"
+      "--keep-daily 7"
+      "--keep-weekly 4"
+      "--keep-monthly 3"
+    ];
+  };
 }