From 271fa9ec359f4f4041633452134bd5f7d6f49871 Mon Sep 17 00:00:00 2001 From: Constantin Gierczak--Galle Date: Thu, 21 Nov 2024 18:40:50 +0100 Subject: [PATCH] fix: fmt --- machines/photo01/_configuration.nix | 45 +++++++++++++------- machines/photo01/_hardware-configuration.nix | 11 +++-- machines/photo01/immich.nix | 3 +- machines/photo01/photoprism.nix | 25 ++++++----- 4 files changed, 54 insertions(+), 30 deletions(-) diff --git a/machines/photo01/_configuration.nix b/machines/photo01/_configuration.nix index 18363b9..821a18c 100644 --- a/machines/photo01/_configuration.nix +++ b/machines/photo01/_configuration.nix @@ -1,7 +1,12 @@ # TODO: revamp to use the same framework as the other VMs -{ lib, pkgs, inputs, ... }: +{ + pkgs, + inputs, + ... +}: -let address = "129.199.146.101"; +let + address = "129.199.146.101"; in { imports = [ @@ -28,7 +33,9 @@ in services.openssh = { enable = true; - settings = { PasswordAuthentication = false; }; + settings = { + PasswordAuthentication = false; + }; }; users.users.root.openssh.authorizedKeys.keys = [ @@ -39,7 +46,12 @@ in security.acme.acceptTerms = true; security.acme.defaults.email = "webmaster@nixos.org"; - networking.firewall.allowedTCPPorts = [ 22 80 443 8007 ]; + networking.firewall.allowedTCPPorts = [ + 22 + 80 + 443 + 8007 + ]; networking.firewall.allowedUDPPorts = [ ]; networking.useNetworkd = true; @@ -75,23 +87,26 @@ in nix = { settings = { - trusted-users = [ "@wheel" "root" "nix-ssh" ]; + trusted-users = [ + "@wheel" + "root" + "nix-ssh" + ]; auto-optimise-store = true; }; #package = pkgs.nixUnstable; - extraOptions = let - empty_registry = builtins.toFile "empty-flake-registry.json" - ''{"flakes":[],"version":2}''; - in '' - experimental-features = nix-command flakes - flake-registry = ${empty_registry} - builders-use-substitutes = true - ''; + extraOptions = + let + empty_registry = builtins.toFile "empty-flake-registry.json" ''{"flakes":[],"version":2}''; + in + '' + experimental-features = nix-command flakes + flake-registry = ${empty_registry} + builders-use-substitutes = true + ''; registry.nixpkgs.flake = inputs.nixpkgs; nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; }; - system.stateVersion = "24.05"; } - diff --git a/machines/photo01/_hardware-configuration.nix b/machines/photo01/_hardware-configuration.nix index 9ce9955..d9ffbf4 100644 --- a/machines/photo01/_hardware-configuration.nix +++ b/machines/photo01/_hardware-configuration.nix @@ -3,8 +3,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 = [ ]; boot.extraModulePackages = [ ]; @@ -13,4 +19,3 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; } - diff --git a/machines/photo01/immich.nix b/machines/photo01/immich.nix index e252ce9..d19721c 100644 --- a/machines/photo01/immich.nix +++ b/machines/photo01/immich.nix @@ -9,8 +9,7 @@ services.nginx.virtualHosts."immich.cgiga.fr" = { enableACME = true; forceSSL = true; - serverAliases = []; + serverAliases = [ ]; locations."/".proxyPass = "http://localhost:2283/"; }; } - diff --git a/machines/photo01/photoprism.nix b/machines/photo01/photoprism.nix index 0ee31da..5398c5d 100644 --- a/machines/photo01/photoprism.nix +++ b/machines/photo01/photoprism.nix @@ -1,6 +1,10 @@ -{ lib, modulesPath, pkgs, ... }: +{ + pkgs, + ... +}: -let port = 2342; +let + port = 2342; in { services.photoprism = { @@ -32,22 +36,23 @@ in dataDir = "/data/mysql"; package = pkgs.mariadb; ensureDatabases = [ "photoprism" ]; - ensureUsers = [{ - name = "photoprism"; - ensurePermissions = { - "photoprism.*" = "ALL PRIVILEGES"; - }; - }]; + ensureUsers = [ + { + name = "photoprism"; + ensurePermissions = { + "photoprism.*" = "ALL PRIVILEGES"; + }; + } + ]; }; services.nginx.virtualHosts."photoprism.cgiga.fr" = { enableACME = true; forceSSL = true; - serverAliases = []; + serverAliases = [ ]; locations."/" = { proxyPass = "http://localhost:${toString port}/"; proxyWebsockets = true; }; }; } -