diff --git a/clients/quadphone/hardware-configuration.nix b/clients/quadphone/hardware-configuration.nix index 16dd578..0102b7c 100644 --- a/clients/quadphone/hardware-configuration.nix +++ b/clients/quadphone/hardware-configuration.nix @@ -4,16 +4,17 @@ crossPkgs, lib, ... -}: { +}: +{ imports = [ - (_: - import - "${inputs.sdm845}/nixos/profiles/boot/kernel/sdm845-mainline" - { + ( + _: + import "${inputs.sdm845}/nixos/profiles/boot/kernel/sdm845-mainline" { inherit lib config; pkgs = crossPkgs; inputs = inputs.sdm845.inputs; - }) + } + ) ]; boot.initrd.allowMissingModules = true; diff --git a/clients/quadraticpc/binfmt/default.nix b/clients/quadraticpc/binfmt/default.nix index d44fe9a..5b180c0 100644 --- a/clients/quadraticpc/binfmt/default.nix +++ b/clients/quadraticpc/binfmt/default.nix @@ -1,10 +1,10 @@ { - boot.binfmt.emulatedSystems = ["aarch64-linux"]; + boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; nixpkgs.overlays = [ (_: super: { # Because of https://github.com/NixOS/nixpkgs/pull/378579 qemu = super.qemu.overrideAttrs (old: { - patches = (old.patches or []) ++ [./qemu.patch]; + patches = (old.patches or [ ]) ++ [ ./qemu.patch ]; }); }) ]; diff --git a/clients/quadraticpc/hardware-configuration.nix b/clients/quadraticpc/hardware-configuration.nix index eebf467..2422470 100644 --- a/clients/quadraticpc/hardware-configuration.nix +++ b/clients/quadraticpc/hardware-configuration.nix @@ -7,15 +7,23 @@ pkgs, modulesPath, ... -}: { +}: +{ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-amd"]; - boot.extraModulePackages = []; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; fileSystems."/" = { device = "/dev/disk/by-uuid/7d01741d-d58f-49d4-b3a2-4d37d953873d"; @@ -27,7 +35,7 @@ fsType = "vfat"; }; - swapDevices = []; + swapDevices = [ ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/clients/quadraticpc/monitor.nix b/clients/quadraticpc/monitor.nix index 603eca6..674f86c 100644 --- a/clients/quadraticpc/monitor.nix +++ b/clients/quadraticpc/monitor.nix @@ -2,14 +2,19 @@ pkgs, lib, ... -}: let +}: +let setvcp = "${lib.meta.getExe pkgs.ddcutil} setvcp D6"; -in { +in +{ hardware.i2c.enable = true; systemd.services = { monitor-off = rec { script = "${setvcp} 05"; - wantedBy = ["sleep.target" "final.target"]; + wantedBy = [ + "sleep.target" + "final.target" + ]; before = wantedBy; serviceConfig.Type = "oneshot"; @@ -18,7 +23,10 @@ in { monitor-on = rec { script = "${setvcp} 01"; - wantedBy = ["sleep.target" "multi-user.target"]; + wantedBy = [ + "sleep.target" + "multi-user.target" + ]; after = wantedBy; }; }; diff --git a/clients/quadraticpc/wheel.nix b/clients/quadraticpc/wheel.nix index b61ab00..5eb1323 100644 --- a/clients/quadraticpc/wheel.nix +++ b/clients/quadraticpc/wheel.nix @@ -2,10 +2,14 @@ pkgs, config, ... -}: { - boot.blacklistedKernelModules = ["xpad"]; - boot.extraModulePackages = [config.boot.kernelPackages.hid-tmff2]; +}: +{ + boot.blacklistedKernelModules = [ "xpad" ]; + boot.extraModulePackages = [ config.boot.kernelPackages.hid-tmff2 ]; - environment.systemPackages = with pkgs; [oversteer linuxConsoleTools]; - services.udev.packages = [pkgs.oversteer]; + environment.systemPackages = with pkgs; [ + oversteer + linuxConsoleTools + ]; + services.udev.packages = [ pkgs.oversteer ]; } diff --git a/clients/quadraticserver/dav.nix b/clients/quadraticserver/dav.nix index d099f91..19e97d3 100644 --- a/clients/quadraticserver/dav.nix +++ b/clients/quadraticserver/dav.nix @@ -1,36 +1,39 @@ -{config, ...}: { - services = let - domain = "dav.henryhiles.com"; - in { - davis = { - enable = true; - hostname = domain; - appSecretFile = config.age.secrets."davSecret.age".path; - adminPasswordFile = config.age.secrets."davPassword.age".path; +{ config, ... }: +{ + services = + let + domain = "dav.henryhiles.com"; + in + { + davis = { + enable = true; + hostname = domain; + appSecretFile = config.age.secrets."davSecret.age".path; + adminPasswordFile = config.age.secrets."davPassword.age".path; - poolConfig = with config.services.caddy; { - "listen.owner" = user; - "listen.group" = group; + poolConfig = with config.services.caddy; { + "listen.owner" = user; + "listen.group" = group; + }; + nginx = null; }; - nginx = null; + + caddy.virtualHosts."${domain}".extraConfig = '' + encode zstd gzip + header { + -Server + -X-Powered-By + Strict-Transport-Security max-age=31536000; + X-Content-Type-Options nosniff + Referrer-Policy no-referrer-when-downgrade + } + + root * ${config.services.davis.package}/public + php_fastcgi unix/${config.services.phpfpm.pools.davis.socket} + file_server + + redir /.well-known/carddav /dav/ 301 + redir /.well-known/caldav /dav/ 301 + ''; }; - - caddy.virtualHosts."${domain}".extraConfig = '' - encode zstd gzip - header { - -Server - -X-Powered-By - Strict-Transport-Security max-age=31536000; - X-Content-Type-Options nosniff - Referrer-Policy no-referrer-when-downgrade - } - - root * ${config.services.davis.package}/public - php_fastcgi unix/${config.services.phpfpm.pools.davis.socket} - file_server - - redir /.well-known/carddav /dav/ 301 - redir /.well-known/caldav /dav/ 301 - ''; - }; } diff --git a/clients/quadraticserver/docs/default.nix b/clients/quadraticserver/docs/default.nix index d0c53c5..6031311 100644 --- a/clients/quadraticserver/docs/default.nix +++ b/clients/quadraticserver/docs/default.nix @@ -47,16 +47,13 @@ in enableNginx = false; redis.createLocally = true; postgresql.createLocally = true; - backendPackage = inputs.nixpkgs-lasuite.legacyPackages.${pkgs.system}.lasuite-docs.overrideAttrs { + backendPackage = pkgs.lasuite-docs.overrideAttrs { patches = [ ./enable-languages.patch ]; }; - collaborationServer.package = - inputs.nixpkgs-lasuite.legacyPackages.${pkgs.system}.lasuite-docs-collaboration-server; - frontendPackage = - inputs.nixpkgs-lasuite.legacyPackages.${pkgs.system}.lasuite-docs-frontend.overrideAttrs - { - NEXT_PUBLIC_PUBLISH_AS_MIT = "false"; - }; + collaborationServer.package = pkgs.lasuite-docs-collaboration-server; + frontendPackage = pkgs.lasuite-docs-frontend.overrideAttrs { + NEXT_PUBLIC_PUBLISH_AS_MIT = "false"; + }; bind = "unix:${socket}"; inherit s3Url domain; diff --git a/clients/quadraticserver/forgejo.nix b/clients/quadraticserver/forgejo.nix index 341a5e7..d90ac83 100644 --- a/clients/quadraticserver/forgejo.nix +++ b/clients/quadraticserver/forgejo.nix @@ -2,53 +2,56 @@ pkgs, config, ... -}: { - networking.firewall.allowedTCPPorts = [22]; - services = let - domain = "git.federated.nexus"; - socket = "/run/forgejo/socket"; - in { - forgejo = { - enable = true; - package = pkgs.forgejo; # Not LTS - settings = { - service = { - ENABLE_INTERNAL_SIGNIN = false; - ALLOW_ONLY_EXTERNAL_REGISTRATION = true; +}: +{ + networking.firewall.allowedTCPPorts = [ 22 ]; + services = + let + domain = "git.federated.nexus"; + socket = "/run/forgejo/socket"; + in + { + forgejo = { + enable = true; + package = pkgs.forgejo; # Not LTS + settings = { + service = { + ENABLE_INTERNAL_SIGNIN = false; + ALLOW_ONLY_EXTERNAL_REGISTRATION = true; + }; + oauth2_client.ENABLE_AUTO_REGISTRATION = true; + repository.GO_GET_CLONE_URL_PROTOCOL = "ssh"; + actions.DEFAULT_ACTIONS_URL = "github"; + + server = { + DOMAIN = domain; + ROOT_URL = "https://${domain}"; + HTTP_ADDR = socket; + PROTOCOL = "http+unix"; + + START_SSH_SERVER = true; + BUILTIN_SSH_SERVER_USER = "git"; + + LANDING_PAGE = "explore"; + }; + + federation.enable = true; }; - oauth2_client.ENABLE_AUTO_REGISTRATION = true; - repository.GO_GET_CLONE_URL_PROTOCOL = "ssh"; - actions.DEFAULT_ACTIONS_URL = "github"; - - server = { - DOMAIN = domain; - ROOT_URL = "https://${domain}"; - HTTP_ADDR = socket; - PROTOCOL = "http+unix"; - - START_SSH_SERVER = true; - BUILTIN_SSH_SERVER_USER = "git"; - - LANDING_PAGE = "explore"; - }; - - federation.enable = true; }; + + caddy.virtualHosts."${domain}".extraConfig = '' + respond /robots.txt <