From d821d5ecbcb07f2f2c148c6cbabbd62a2f358161 Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Mon, 16 Aug 2021 10:09:56 +0200 Subject: config/services/web/default.nix move ihatemoney to money.aristote.fr --- config/services/web/default.nix | 2 +- config/services/web/money/default.nix | 27 ++++++++++++++++++++ config/services/web/quentin/default.nix | 4 +-- config/services/web/quentin/ihatemoney/default.nix | 29 ---------------------- 4 files changed, 29 insertions(+), 33 deletions(-) create mode 100644 config/services/web/money/default.nix delete mode 100644 config/services/web/quentin/ihatemoney/default.nix diff --git a/config/services/web/default.nix b/config/services/web/default.nix index 665e0c0..091fca4 100644 --- a/config/services/web/default.nix +++ b/config/services/web/default.nix @@ -1,7 +1,7 @@ { ... }: { - imports = [ ./quentin ./searx ]; + imports = [ ./money ./quentin ./searx ]; security.acme = { acceptTerms = true; diff --git a/config/services/web/money/default.nix b/config/services/web/money/default.nix new file mode 100644 index 0000000..9a84e07 --- /dev/null +++ b/config/services/web/money/default.nix @@ -0,0 +1,27 @@ +{ lib, config, ... }: + +let cfg = config.services.ihatemoney; +in { + services.nginx.virtualHosts."money.aristote.fr" = lib.mkIf cfg.enable { + forceSSL = true; + enableACME = true; + "/".proxyPass = "http://127.0.0.1${cfg.uwsgiConfig.http}/"; + }; + + services.ihatemoney = { + enable = true; + enableAdminDashboard = true; + adminHashedPassword = + "pbkdf2:sha256:150000$s78RCYkJ$9c15a62ed1c89625cb78b5bde87d03b6dd1a03831afa4dbb2abb15ea4c1e150b"; + uwsgiConfig = { http = ":8000"; }; + }; + + services.opensmtpd = lib.mkIf cfg.enable { + enable = true; + serverConfiguration = '' + listen on lo + action block mda "cat >/dev/null" + match from any for any action block + ''; + }; +} diff --git a/config/services/web/quentin/default.nix b/config/services/web/quentin/default.nix index 78796bb..da21d59 100644 --- a/config/services/web/quentin/default.nix +++ b/config/services/web/quentin/default.nix @@ -1,8 +1,6 @@ -{ pkgs, lib, config, ... }: +{ pkgs, ... }: { - imports = [ ./ihatemoney ]; - services.nginx.virtualHosts."quentin.aristote.fr" = { locations."/".root = "${pkgs.personal.academic-webpage}"; forceSSL = true; diff --git a/config/services/web/quentin/ihatemoney/default.nix b/config/services/web/quentin/ihatemoney/default.nix deleted file mode 100644 index df94392..0000000 --- a/config/services/web/quentin/ihatemoney/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ lib, config, ... }: - -let cfg = config.services.ihatemoney; -in { - services.nginx.virtualHosts."quentin.aristote.fr".locations = - lib.mkIf cfg.enable { - "/money/".proxyPass = "http://127.0.0.1${cfg.uwsgiConfig.http}/"; - }; - - services.ihatemoney = { - enable = true; - enableAdminDashboard = true; - adminHashedPassword = - "pbkdf2:sha256:150000$s78RCYkJ$9c15a62ed1c89625cb78b5bde87d03b6dd1a03831afa4dbb2abb15ea4c1e150b"; - uwsgiConfig = { http = ":8000"; }; - extraConfig = '' - APPLICATION_ROOT = "https://quentin.aristote.fr/money/" - ''; - }; - - services.opensmtpd = lib.mkIf cfg.enable { - enable = true; - serverConfiguration = '' - listen on lo - action block mda "cat >/dev/null" - match from any for any action block - ''; - }; -} -- cgit v1.2.3