diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-18 10:49:00 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-18 10:49:00 +0200 |
commit | f8026b6e4c869aa108f6361c8ccd50890657994d (patch) | |
tree | 57cb311e520933bd2ab6ccbae05f2913799eb49e /modules/private/websites/piedsjaloux/production.nix | |
parent | 4aac110f17f0528d90510eec00c9a8df60bcf04f (diff) | |
download | Nix-f8026b6e4c869aa108f6361c8ccd50890657994d.tar.gz Nix-f8026b6e4c869aa108f6361c8ccd50890657994d.tar.zst Nix-f8026b6e4c869aa108f6361c8ccd50890657994d.zip |
Move personal websites to modules
Diffstat (limited to 'modules/private/websites/piedsjaloux/production.nix')
-rw-r--r-- | modules/private/websites/piedsjaloux/production.nix | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/modules/private/websites/piedsjaloux/production.nix b/modules/private/websites/piedsjaloux/production.nix new file mode 100644 index 0000000..afa1667 --- /dev/null +++ b/modules/private/websites/piedsjaloux/production.nix | |||
@@ -0,0 +1,36 @@ | |||
1 | { lib, pkgs, config, myconfig, ... }: | ||
2 | let | ||
3 | piedsjaloux = pkgs.callPackage ./builder.nix { | ||
4 | inherit (pkgs.webapps) piedsjaloux; | ||
5 | config = myconfig.env.websites.piedsjaloux.production; | ||
6 | apacheUser = config.services.httpd.Prod.user; | ||
7 | apacheGroup = config.services.httpd.Prod.group; | ||
8 | }; | ||
9 | |||
10 | cfg = config.myServices.websites.piedsjaloux.production; | ||
11 | in { | ||
12 | options.myServices.websites.piedsjaloux.production.enable = lib.mkEnableOption "enable PiedsJaloux's website in production"; | ||
13 | |||
14 | config = lib.mkIf cfg.enable { | ||
15 | secrets.keys = piedsjaloux.keys; | ||
16 | services.webstats.sites = [ { name = "piedsjaloux.fr"; } ]; | ||
17 | |||
18 | services.myPhpfpm.preStart.piedsjaloux_prod = piedsjaloux.phpFpm.preStart; | ||
19 | services.myPhpfpm.serviceDependencies.piedsjaloux_prod = piedsjaloux.phpFpm.serviceDeps; | ||
20 | services.myPhpfpm.poolConfigs.piedsjaloux_prod = piedsjaloux.phpFpm.pool; | ||
21 | system.activationScripts.piedsjaloux_prod = piedsjaloux.activationScript; | ||
22 | system.extraSystemBuilderCmds = '' | ||
23 | mkdir -p $out/webapps | ||
24 | ln -s ${piedsjaloux.app.webRoot} $out/webapps/${piedsjaloux.apache.webappName} | ||
25 | ''; | ||
26 | services.websites.production.modules = piedsjaloux.apache.modules; | ||
27 | services.websites.production.vhostConfs.piedsjaloux = { | ||
28 | certName = "piedsjaloux"; | ||
29 | certMainHost = "piedsjaloux.fr"; | ||
30 | hosts = [ "piedsjaloux.fr" "www.piedsjaloux.fr" ]; | ||
31 | root = piedsjaloux.apache.root; | ||
32 | extraConfig = [ piedsjaloux.apache.vhostConf ]; | ||
33 | }; | ||
34 | }; | ||
35 | } | ||
36 | |||