aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2021-09-14 02:28:09 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2021-09-30 00:36:14 +0200
commita9f52ec521e45204ad9363dd143b32ac9910b6b3 (patch)
tree6257e8385c240890e1f8c443e8aa886de09ad523 /modules
parente4e0de77cd6c9882fa7ff7c3cdd0ed9fce8a59d8 (diff)
downloadNix-a9f52ec521e45204ad9363dd143b32ac9910b6b3.tar.gz
Nix-a9f52ec521e45204ad9363dd143b32ac9910b6b3.tar.zst
Nix-a9f52ec521e45204ad9363dd143b32ac9910b6b3.zip
Add flask app paste
Diffstat (limited to 'modules')
-rw-r--r--modules/default.nix1
-rw-r--r--modules/private/websites/tools/tools/default.nix28
-rw-r--r--modules/private/websites/tools/tools/ympd.nix8
3 files changed, 20 insertions, 17 deletions
diff --git a/modules/default.nix b/modules/default.nix
index 1b09c94..7ce1cc2 100644
--- a/modules/default.nix
+++ b/modules/default.nix
@@ -13,6 +13,7 @@ in
13 mediagoblin = ./webapps/mediagoblin.nix; 13 mediagoblin = ./webapps/mediagoblin.nix;
14 peertube = (flakeCompat ../flakes/peertube).nixosModule; 14 peertube = (flakeCompat ../flakes/peertube).nixosModule;
15 fiche = ./webapps/fiche.nix; 15 fiche = ./webapps/fiche.nix;
16 paste = (flakeCompat ../flakes/paste).nixosModule;
16 17
17 opendmarc = (flakeCompat ../flakes/opendmarc).nixosModule; 18 opendmarc = (flakeCompat ../flakes/opendmarc).nixosModule;
18 openarc = (flakeCompat ../flakes/openarc).nixosModule; 19 openarc = (flakeCompat ../flakes/openarc).nixosModule;
diff --git a/modules/private/websites/tools/tools/default.nix b/modules/private/websites/tools/tools/default.nix
index 6464206..ac92ef4 100644
--- a/modules/private/websites/tools/tools/default.nix
+++ b/modules/private/websites/tools/tools/default.nix
@@ -1,5 +1,7 @@
1{ lib, pkgs, config, ... }: 1{ lib, pkgs, config, ... }:
2let 2let
3 flakeCompat = import ../../../../../lib/flake-compat.nix;
4
3 adminer = pkgs.callPackage ./adminer.nix { 5 adminer = pkgs.callPackage ./adminer.nix {
4 inherit (pkgs.webapps) adminer; 6 inherit (pkgs.webapps) adminer;
5 }; 7 };
@@ -64,6 +66,9 @@ let
64 cfg = config.myServices.websites.tools.tools; 66 cfg = config.myServices.websites.tools.tools;
65 pcfg = config.services.phpfpm.pools; 67 pcfg = config.services.phpfpm.pools;
66in { 68in {
69 imports =
70 builtins.attrValues (flakeCompat ../../../../../flakes/private/paste).nixosModules;
71
67 options.myServices.websites.tools.tools = { 72 options.myServices.websites.tools.tools = {
68 enable = lib.mkEnableOption "enable tools website"; 73 enable = lib.mkEnableOption "enable tools website";
69 }; 74 };
@@ -165,13 +170,16 @@ in {
165 (phpbb.apache.vhostConf pcfg.phpbb.socket) 170 (phpbb.apache.vhostConf pcfg.phpbb.socket)
166 (dmarc-reports.apache.vhostConf pcfg.dmarc-reports.socket) 171 (dmarc-reports.apache.vhostConf pcfg.dmarc-reports.socket)
167 '' 172 ''
168 Alias /paste /var/lib/fiche 173 <Location "/paste/">
169 <Directory "/var/lib/fiche"> 174 ProxyPass unix://${config.services.paste.sockets.gunicorn}|http://tools.immae.eu/paste/
170 DirectoryIndex index.txt index.html 175 ProxyPassReverse unix://${config.services.paste.sockets.gunicorn}|http://tools.immae.eu/paste/
171 AllowOverride None 176 ProxyPreserveHost on
172 Require all granted 177 </Location>
173 Options -Indexes 178 <Location "/paste">
174 </Directory> 179 ProxyPass unix://${config.services.paste.sockets.gunicorn}|http://tools.immae.eu/paste/
180 ProxyPassReverse unix://${config.services.paste.sockets.gunicorn}|http://tools.immae.eu/paste/
181 ProxyPreserveHost on
182 </Location>
175 183
176 Alias /BIP39 /var/lib/buildbot/outputs/immae/bip39 184 Alias /BIP39 /var/lib/buildbot/outputs/immae/bip39
177 <Directory "/var/lib/buildbot/outputs/immae/bip39"> 185 <Directory "/var/lib/buildbot/outputs/immae/bip39">
@@ -437,12 +445,6 @@ in {
437 paths = [ "/var/secrets/webapps/tools-wallabag" ]; 445 paths = [ "/var/secrets/webapps/tools-wallabag" ];
438 }; 446 };
439 447
440 services.fiche = {
441 enable = true;
442 port = config.myEnv.ports.fiche;
443 domain = "tools.immae.eu/paste";
444 https = true;
445 };
446 }; 448 };
447} 449}
448 450
diff --git a/modules/private/websites/tools/tools/ympd.nix b/modules/private/websites/tools/tools/ympd.nix
index 72d45d4..531b1a9 100644
--- a/modules/private/websites/tools/tools/ympd.nix
+++ b/modules/private/websites/tools/tools/ympd.nix
@@ -26,12 +26,12 @@ let
26 ProxyPass ws://${config.webPort}/ws 26 ProxyPass ws://${config.webPort}/ws
27 </Location> 27 </Location>
28 <Location "/mpd/music.mp3"> 28 <Location "/mpd/music.mp3">
29 ProxyPass unix:///run/mpd/mp3.sock|http://tools.immae.eu/ 29 ProxyPass unix:///run/mpd/mp3.sock|http://tools.immae.eu/mpd/mp3
30 ProxyPassReverse unix:///run/mpd/mp3.sock|http://tools.immae.eu/ 30 ProxyPassReverse unix:///run/mpd/mp3.sock|http://tools.immae.eu/mpd/mp3
31 </Location> 31 </Location>
32 <Location "/mpd/music.ogg"> 32 <Location "/mpd/music.ogg">
33 ProxyPass unix:///run/mpd/ogg.sock|http://tools.immae.eu/ 33 ProxyPass unix:///run/mpd/ogg.sock|http://tools.immae.eu/mpd/ogg
34 ProxyPassReverse unix:///run/mpd/ogg.sock|http://tools.immae.eu/ 34 ProxyPassReverse unix:///run/mpd/ogg.sock|http://tools.immae.eu/mpd/ogg
35 </Location> 35 </Location>
36 ''; 36 '';
37 }; 37 };