From 611709cb6205c65874c95d891d0f1188ad9883eb Mon Sep 17 00:00:00 2001 From: awkawb Date: Thu, 2 Jan 2025 16:53:58 -0500 Subject: [PATCH] nixos-module/invoiceninja.nix: changed nixos module definition for nginx to allow local development, removed unneeded link in data setup service --- nixos-module/invoiceninja.nix | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/nixos-module/invoiceninja.nix b/nixos-module/invoiceninja.nix index 679d17b..a3e7fe5 100644 --- a/nixos-module/invoiceninja.nix +++ b/nixos-module/invoiceninja.nix @@ -1,10 +1,9 @@ -{ - config, - lib, - modulesPath, - options, - pkgs, - ... +{ config +, lib +, modulesPath +, options +, pkgs +, ... }: let @@ -485,7 +484,7 @@ in services.nginx = lib.mkIf (cfg.proxy.server == "nginx") { enable = true; - recommendedTlsSettings = true; + recommendedTlsSettings = (if (cfg.hostname == "localhost") then false else true); recommendedGzipSettings = true; recommendedProxySettings = true; recommendedOptimisation = true; @@ -496,8 +495,8 @@ in cfg.proxy.nginxConfig { root = lib.mkForce "${invoiceninja}/public"; - addSSL = lib.mkForce true; - enableACME = lib.mkForce true; + addSSL = lib.mkForce (if (cfg.hostname == "localhost") then false else true); + enableACME = lib.mkForce (if (cfg.hostname == "localhost") then false else true); locations = { "/".tryFiles = "$uri $uri/ /index.php?$query_string"; "/".extraConfig = '' @@ -655,9 +654,6 @@ in # Link the static storage (package provided) to the runtime storage rsync -av --no-perms ${invoiceninja}/storage-static/ ${cfg.dataDir}/storage - # Link the static vendor/bin (package provided) to the runtime vendor/bin - rsync -av --no-perms ${invoiceninja}/vendor/bin-static/ ${cfg.dataDir}/vendor/bin - # Link the app.php in the runtime folder. # We cannot link the cache folder only because bootstrap folder needs to be writeable. ln -sf ${invoiceninja}/bootstrap-static/app.php ${cfg.runtimeDir}/app.php