summary refs log tree commit diff stats
path: root/system/settings
diff options
context:
space:
mode:
Diffstat (limited to 'system/settings')
-rw-r--r--system/settings/dev.nix59
-rw-r--r--system/settings/gaming.nix4
-rw-r--r--system/settings/services/git-server.nix35
3 files changed, 79 insertions, 19 deletions
diff --git a/system/settings/dev.nix b/system/settings/dev.nix
new file mode 100644
index 00000000..b1817914
--- /dev/null
+++ b/system/settings/dev.nix
@@ -0,0 +1,59 @@
+{ ... }: {
+  services.caddy = {
+    enable = true;
+    virtualHosts =
+      let
+        local_tls = ''
+          tls {
+            issuer internal {
+              ca local
+            }
+          }
+        '';
+      in
+      {
+        "localhost" = {
+          logFormat = "output discard";
+          extraConfig = ''
+            ${local_tls}
+            acme_server {
+              allow {
+                domains *.test *.localhost
+              }
+            }
+          '';
+        };
+        # need to test forwarding behaviour
+        "https://alanpearce.localhost" = {
+          logFormat = "output discard";
+          serverAliases = [
+            "http://alanpearce.localhost"
+
+            # remember to update /etc/hosts
+            "https://alanpearce.test"
+            "http://alanpearce.test"
+          ];
+          extraConfig = ''
+            ${local_tls}
+            reverse_proxy http://alanpearce.test:8080 {
+              transport http {
+                dial_timeout 1s
+                compression off
+              }
+            }
+          '';
+        };
+        "searchix.localhost" = {
+          logFormat = "output discard";
+          extraConfig = ''
+            reverse_proxy http://localhost:7331 {
+              transport http {
+                dial_timeout 1s
+                compression off
+              }
+            }
+          '';
+        };
+      };
+  };
+}
diff --git a/system/settings/gaming.nix b/system/settings/gaming.nix
index 17f25065..d11d5a3c 100644
--- a/system/settings/gaming.nix
+++ b/system/settings/gaming.nix
@@ -19,9 +19,9 @@
   };
   fonts.fontconfig.cache32Bit = true;
   hardware.steam-hardware.enable = true;
-  hardware.opengl = {
+  hardware.graphics = {
     enable = true;
-    driSupport32Bit = true;
+    enable32Bit = true;
   };
   hardware.pulseaudio.support32Bit = true;
   services.pipewire.alsa.support32Bit = true;
diff --git a/system/settings/services/git-server.nix b/system/settings/services/git-server.nix
index 0ef40ccc..e8fe6360 100644
--- a/system/settings/services/git-server.nix
+++ b/system/settings/services/git-server.nix
@@ -4,8 +4,7 @@
 , ...
 }:
 let
-  inherit (builtins) mapAttrs attrValues;
-  inherit (lib) pipe flatten mergeAttrsList mapAttrsToList;
+  inherit (lib) pipe flatten concatMapAttrs mapAttrsToList;
   inherit (import ../../../lib/caddy.nix { inherit lib; }) security-headers;
   repos = "${config.services.gitolite.dataDir}/repositories";
 
@@ -35,7 +34,7 @@ let
   createMirrorService =
     name: { hostname, username }:
     {
-      services."mirror-to-${name}@" = {
+      "mirror-to-${name}@" = {
         path = with pkgs; [ gitMinimal openssh ];
         serviceConfig = {
           Type = "oneshot";
@@ -48,7 +47,11 @@ let
           ConditionPathExists = "${repos}/%i.git/git-daemon-export-ok";
         };
       };
-      paths."mirror-to-${name}@" = {
+    };
+
+  createMirrorPath = name: { hostname, username }:
+    {
+      "mirror-to-${name}@" = {
         pathConfig = {
           PathChanged = "${repos}/%i.git/refs/heads";
           StartLimitIntervalSec = "1h";
@@ -57,6 +60,7 @@ let
       };
     };
 
+
   mkMirrorWants = repo: map (target: "mirror-to-${target}@${repo}.path");
 in
 {
@@ -79,6 +83,7 @@ in
       push( @{$RC{ENABLE}}, 'D' );
       push( @{$RC{ENABLE}}, 'Shell alan' );
       push( @{$RC{ENABLE}}, 'cgit' );
+      push( @{$RC{ENABLE}}, 'repo-specific-hooks' );
     '';
   };
   services.legit = {
@@ -261,18 +266,14 @@ in
     ];
   };
 
-  systemd = (pipe
-    mirrors [
-    (mapAttrsToList createMirrorService)
-    mergeAttrsList
-  ]) // {
-    targets.git-mirroring = {
-      wantedBy = [ "multi-user.target" ];
-      wants = pipe
-        repoMirrors [
-        (mapAttrsToList mkMirrorWants)
-        flatten
-      ];
-    };
+  systemd.services = concatMapAttrs createMirrorService mirrors;
+  systemd.paths = concatMapAttrs createMirrorPath mirrors;
+  systemd.targets.git-mirroring = {
+    wantedBy = [ "multi-user.target" ];
+    wants = pipe
+      repoMirrors [
+      (mapAttrsToList mkMirrorWants)
+      flatten
+    ];
   };
 }