diff options
Diffstat (limited to '')
-rw-r--r-- | nix/machines/vm-hetzner/default.nix | 71 | ||||
-rw-r--r-- | nix/machines/vm-hetzner/hardware.nix | 11 |
2 files changed, 53 insertions, 29 deletions
diff --git a/nix/machines/vm-hetzner/default.nix b/nix/machines/vm-hetzner/default.nix index 889b00d..c7ab4c8 100644 --- a/nix/machines/vm-hetzner/default.nix +++ b/nix/machines/vm-hetzner/default.nix @@ -1,5 +1,9 @@ -{ pkgs, lib, ... }: { - imports = [ ./hardware.nix ../vm-shared.nix ]; +{ pkgs, lib, ... }: +{ + imports = [ + ./hardware.nix + ../vm-shared.nix + ]; boot.tmp.cleanOnBoot = true; zramSwap.enable = true; @@ -14,8 +18,11 @@ # This file was populated at runtime with the networking # details gathered from the active system. networking = { - nameservers = - [ "2a01:4ff:ff00::add:2" "2a01:4ff:ff00::add:1" "185.12.64.1" ]; + nameservers = [ + "2a01:4ff:ff00::add:2" + "2a01:4ff:ff00::add:1" + "185.12.64.1" + ]; defaultGateway = "172.31.1.1"; defaultGateway6 = { address = "fe80::1"; @@ -25,10 +32,12 @@ usePredictableInterfaceNames = lib.mkForce false; interfaces = { eth0 = { - ipv4.addresses = [{ - address = "5.78.87.68"; - prefixLength = 32; - }]; + ipv4.addresses = [ + { + address = "5.78.87.68"; + prefixLength = 32; + } + ]; ipv6.addresses = [ { address = "2a01:4ff:1f0:d1a3::1"; @@ -39,14 +48,18 @@ prefixLength = 64; } ]; - ipv4.routes = [{ - address = "172.31.1.1"; - prefixLength = 32; - }]; - ipv6.routes = [{ - address = "fe80::1"; - prefixLength = 128; - }]; + ipv4.routes = [ + { + address = "172.31.1.1"; + prefixLength = 32; + } + ]; + ipv6.routes = [ + { + address = "fe80::1"; + prefixLength = 128; + } + ]; }; }; @@ -73,8 +86,7 @@ # 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 = '' @@ -102,10 +114,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; @@ -129,7 +139,9 @@ 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" ]; }; @@ -151,7 +163,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"; }; @@ -190,8 +204,13 @@ "/var/lib/gitolite/.ssh" "/var/lib/gitolite/.viminfo" ]; - extraBackupArgs = [ "--exclude-caches" "--compression=max" ]; - timerConfig = { OnCalendar = "*:0/30"; }; + extraBackupArgs = [ + "--exclude-caches" + "--compression=max" + ]; + timerConfig = { + OnCalendar = "*:0/30"; + }; pruneOpts = [ "--keep-hourly 36" "--keep-daily 7" diff --git a/nix/machines/vm-hetzner/hardware.nix b/nix/machines/vm-hetzner/hardware.nix index 89a92a9..351c991 100644 --- a/nix/machines/vm-hetzner/hardware.nix +++ b/nix/machines/vm-hetzner/hardware.nix @@ -1,8 +1,13 @@ -{ modulesPath, ... }: { +{ modulesPath, ... }: +{ imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; - boot.initrd.availableKernelModules = - [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ]; + boot.initrd.availableKernelModules = [ + "ata_piix" + "uhci_hcd" + "xen_blkfront" + "vmw_pvscsi" + ]; boot.loader.grub = { enable = true; |