From 96d584f4813c2914810832c15ecc85021b46014b Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Thu, 15 Sep 2022 22:24:43 +0200 Subject: [PATCH] provide stable diffusion model --- flake.lock | 8 ++++---- nixos/configs/robi/nginx.nix | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 8889184..6559371 100644 --- a/flake.lock +++ b/flake.lock @@ -793,11 +793,11 @@ "private_assets": { "flake": false, "locked": { - "lastModified": 1655934754, - "narHash": "sha256-XLAsp/YoRJbgK4U+SavIQsrhbIRWRrGs3E5IuKMXMLs=", + "lastModified": 1663253057, + "narHash": "sha256-uj5eO4c8v1ybm7pp0SXswFTmGqdTgf1Il3UEiFrEymw=", "ref": "main", - "rev": "a4df343e4fbc250a3e51ddbe732c8dd7e44887da", - "revCount": 1, + "rev": "c9457b3bb7edd04f1a51ade9868692ee1902d511", + "revCount": 2, "type": "git", "url": "ssh://gitea@git.ingolf-wagner.de/palo/nixos-private-assets.git" }, diff --git a/nixos/configs/robi/nginx.nix b/nixos/configs/robi/nginx.nix index befd0db..c3000f6 100644 --- a/nixos/configs/robi/nginx.nix +++ b/nixos/configs/robi/nginx.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, private_assets, ... }: let # todo create flake for this errorPages = pkgs.fetchFromGitHub { @@ -38,6 +38,22 @@ in enable = true; recommendedProxySettings = true; virtualHosts = { + "stable-diffusion.ingolf-wagner.de" = { + forceSSL = true; + enableACME = true; + extraConfig = error.extraConfig; + root = "/srv/www/stable-diffusion"; + locations = { + "/model-v1-4.ckpt" = { + basicAuthFile = "${private_assets}/stable-diffusion-htpasswd"; + tryFiles = "/stable-diffusion-v-1-4-original/sd-v1-4.ckpt =404"; + }; + #"/model-v1-3.ckpt" = { + # basicAuthFile = "${private_assets}/stable-diffusion-htpasswd"; + # tryFiles = "stable-diffusion-v-1-3-original/sd-v1-3.ckpt"; + #}; + } // error.locations; + }; "travel.ingolf-wagner.de" = { forceSSL = true; enableACME = true;