]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/websites/nicecoop/copanier.nix
Add flake skeletons
[perso/Immae/Config/Nix.git] / modules / private / websites / nicecoop / copanier.nix
index 5e2c2a899c7da6354acb1a8a8c66a312d024159b..a50f296e245f446d256437ac3bd4749a9bb43924 100644 (file)
@@ -1,9 +1,10 @@
-{ lib, config, pkgs, ... }:
+{ lib, config, pkgs, flakes, ... }:
 let
   cfg = config.myServices.websites.nicecoop.copanier;
   pcfg = config.myEnv.websites.nicecoop.copanier;
   hostname = "copanier.nc.immae.dev";
   socket = "/run/nicecoop_copanier/socket.sock";
+  copanier = flakes.subflakes.public.copanier.defaultPackage.x86_64-linux;
 in {
   options.myServices.websites.nicecoop.copanier.enable = lib.mkEnableOption "enable nicecoop's copanier website";
 
@@ -22,8 +23,8 @@ in {
         ProxyPassMatch ^/static !
         ProxyPass / unix://${socket}|http://${hostname}/
         ProxyPassReverse / unix://${socket}|http://${hostname}/
-        Alias /static ${pkgs.webapps.copanier}/${pkgs.webapps.copanier.python.sitePackages}/copanier/static
-        <Directory ${pkgs.webapps.copanier}/${pkgs.webapps.copanier.python.sitePackages}/copanier/static>
+        Alias /static ${copanier}/${copanier.python.sitePackages}/copanier/static
+        <Directory ${copanier}/${copanier.python.sitePackages}/copanier/static>
           AllowOverride None
           Require all granted
         </Directory>
@@ -59,7 +60,7 @@ in {
         EnvironmentFile = config.secrets.fullPaths."websites/nicecoop/copanier";
         Type = "simple";
         ExecStart = let
-          python = pkgs.webapps.copanier.python.withPackages (p: [ p.gunicorn p.uvloop pkgs.webapps.copanier ]);
+          python = copanier.python.withPackages (p: [ p.gunicorn p.uvloop copanier ]);
         in
           "${python}/bin/gunicorn -k roll.worker.Worker copanier:app --bind unix:${socket}";
         User = "wwwrun";