about summary refs log tree commit diff
path: root/nix/machines/vm-synology
diff options
context:
space:
mode:
Diffstat (limited to 'nix/machines/vm-synology')
-rw-r--r--nix/machines/vm-synology/ddns.nix6
-rw-r--r--nix/machines/vm-synology/default.nix11
-rw-r--r--nix/machines/vm-synology/git.nix37
-rw-r--r--nix/machines/vm-synology/hardware.nix15
-rw-r--r--nix/machines/vm-synology/web.nix11
5 files changed, 53 insertions, 27 deletions
diff --git a/nix/machines/vm-synology/ddns.nix b/nix/machines/vm-synology/ddns.nix
index df59793..837bfa7 100644
--- a/nix/machines/vm-synology/ddns.nix
+++ b/nix/machines/vm-synology/ddns.nix
@@ -1,4 +1,5 @@
-{ ... }: {
+{ ... }:
+{
   age.secrets.ddns-updater = {
     file = ../../../secrets/ddns-updater.age;
     owner = "root";
@@ -16,6 +17,5 @@
   };
 
   # https://systemd.io/CREDENTIALS/
-  systemd.services.ddns-updater.serviceConfig.LoadCredential =
-    "config.json:/run/agenix/ddns-updater";
+  systemd.services.ddns-updater.serviceConfig.LoadCredential = "config.json:/run/agenix/ddns-updater";
 }
diff --git a/nix/machines/vm-synology/default.nix b/nix/machines/vm-synology/default.nix
index 68952c6..8e8dfc5 100644
--- a/nix/machines/vm-synology/default.nix
+++ b/nix/machines/vm-synology/default.nix
@@ -1,5 +1,12 @@
-{ ... }: {
-  imports = [ ./hardware.nix ../vm-shared.nix ./ddns.nix ./web.nix ./git.nix ];
+{ ... }:
+{
+  imports = [
+    ./hardware.nix
+    ../vm-shared.nix
+    ./ddns.nix
+    ./web.nix
+    ./git.nix
+  ];
 
   # Use the systemd-boot EFI boot loader.
   boot.loader.systemd-boot.enable = true;
diff --git a/nix/machines/vm-synology/git.nix b/nix/machines/vm-synology/git.nix
index 698f375..1e6a9e6 100644
--- a/nix/machines/vm-synology/git.nix
+++ b/nix/machines/vm-synology/git.nix
@@ -1,10 +1,10 @@
-{ pkgs, lib, ... }: {
+{ pkgs, lib, ... }:
+{
 
   # https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/misc/gitolite.nix
   services.gitolite = {
     enable = true;
-    adminPubkey =
-      "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINBkozy+X96u5ciX766bJ/AyQ3xm1tXZTIr5+4PVFZFi";
+    adminPubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINBkozy+X96u5ciX766bJ/AyQ3xm1tXZTIr5+4PVFZFi";
     user = "git";
     group = "git";
     extraGitoliteRc = ''
@@ -19,12 +19,10 @@
 
   # let's make sure the default branch is `main'.
   systemd.tmpfiles.rules = [
-    "C /var/lib/gitolite/.gitconfig - git git 0644 ${
-      pkgs.writeText "gitolite-gitconfig" ''
-        [init]
-        	defaultBranch = main
-      ''
-    }"
+    "C /var/lib/gitolite/.gitconfig - git git 0644 ${pkgs.writeText "gitolite-gitconfig" ''
+      [init]
+      	defaultBranch = main
+    ''}"
   ];
 
   services.cgit.main = {
@@ -43,10 +41,8 @@
       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;
@@ -88,8 +84,17 @@
       "/var/lib/gitolite/.ssh"
       "/var/lib/gitolite/.viminfo"
     ];
-    extraBackupArgs = [ "--exclude-caches" "--compression=max" ];
-    timerConfig = { OnCalendar = "daily"; };
-    pruneOpts = [ "--keep-daily 7" "--keep-weekly 4" "--keep-monthly 3" ];
+    extraBackupArgs = [
+      "--exclude-caches"
+      "--compression=max"
+    ];
+    timerConfig = {
+      OnCalendar = "daily";
+    };
+    pruneOpts = [
+      "--keep-daily 7"
+      "--keep-weekly 4"
+      "--keep-monthly 3"
+    ];
   };
 }
diff --git a/nix/machines/vm-synology/hardware.nix b/nix/machines/vm-synology/hardware.nix
index 5511e98..cd1d5e7 100644
--- a/nix/machines/vm-synology/hardware.nix
+++ b/nix/machines/vm-synology/hardware.nix
@@ -6,8 +6,14 @@
 {
   imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
 
-  boot.initrd.availableKernelModules =
-    [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
+  boot.initrd.availableKernelModules = [
+    "ata_piix"
+    "uhci_hcd"
+    "virtio_pci"
+    "virtio_scsi"
+    "sd_mod"
+    "sr_mod"
+  ];
   boot.initrd.kernelModules = [ ];
   boot.kernelModules = [ "kvm-amd" ];
   boot.extraModulePackages = [ ];
@@ -20,7 +26,10 @@
   fileSystems."/boot" = {
     device = "/dev/disk/by-label/boot";
     fsType = "vfat";
-    options = [ "fmask=0022" "dmask=0022" ];
+    options = [
+      "fmask=0022"
+      "dmask=0022"
+    ];
   };
 
   swapDevices = [ ];
diff --git a/nix/machines/vm-synology/web.nix b/nix/machines/vm-synology/web.nix
index f9c34cc..03fe831 100644
--- a/nix/machines/vm-synology/web.nix
+++ b/nix/machines/vm-synology/web.nix
@@ -1,9 +1,12 @@
-{ ... }: {
+{ ... }:
+{
   # container for excalidraw
   virtualisation.oci-containers.containers.excalidraw = {
     autoStart = true;
     image = "excalidraw/excalidraw:latest";
-    environment = { TZ = "America/Los_Angeles"; };
+    environment = {
+      TZ = "America/Los_Angeles";
+    };
     ports = [ "127.0.0.1:3030:80" ];
     extraOptions = [ "--pull=always" ];
   };
@@ -30,7 +33,9 @@
         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";
           };