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 /nixops/modules/websites/chloe/default.nix | |
parent | 4aac110f17f0528d90510eec00c9a8df60bcf04f (diff) | |
download | Nix-f8026b6e4c869aa108f6361c8ccd50890657994d.tar.gz Nix-f8026b6e4c869aa108f6361c8ccd50890657994d.tar.zst Nix-f8026b6e4c869aa108f6361c8ccd50890657994d.zip |
Move personal websites to modules
Diffstat (limited to 'nixops/modules/websites/chloe/default.nix')
-rw-r--r-- | nixops/modules/websites/chloe/default.nix | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/nixops/modules/websites/chloe/default.nix b/nixops/modules/websites/chloe/default.nix deleted file mode 100644 index 8e801b5..0000000 --- a/nixops/modules/websites/chloe/default.nix +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | { lib, pkgs, config, myconfig, ... }: | ||
2 | let | ||
3 | chloe_dev = pkgs.callPackage ./chloe.nix { | ||
4 | inherit (pkgs.webapps) chloe; | ||
5 | config = myconfig.env.websites.chloe.integration; | ||
6 | }; | ||
7 | chloe_prod = pkgs.callPackage ./chloe.nix { | ||
8 | inherit (pkgs.webapps) chloe; | ||
9 | config = myconfig.env.websites.chloe.production; | ||
10 | }; | ||
11 | |||
12 | cfg = config.services.myWebsites.Chloe; | ||
13 | in { | ||
14 | options.services.myWebsites.Chloe = { | ||
15 | production = { | ||
16 | enable = lib.mkEnableOption "enable Chloe's website in production"; | ||
17 | }; | ||
18 | integration = { | ||
19 | enable = lib.mkEnableOption "enable Chloe's website in integration"; | ||
20 | }; | ||
21 | }; | ||
22 | |||
23 | config = lib.mkMerge [ | ||
24 | (lib.mkIf cfg.production.enable { | ||
25 | secrets.keys = chloe_prod.keys; | ||
26 | services.webstats.sites = [ { name = "osteopathe-cc.fr"; } ]; | ||
27 | |||
28 | services.myPhpfpm.serviceDependencies.chloe_prod = chloe_prod.phpFpm.serviceDeps; | ||
29 | services.myPhpfpm.poolConfigs.chloe_prod = chloe_prod.phpFpm.pool; | ||
30 | services.myPhpfpm.poolPhpConfigs.chloe_prod = '' | ||
31 | extension=${pkgs.php}/lib/php/extensions/mysqli.so | ||
32 | ''; | ||
33 | system.activationScripts.chloe_prod = chloe_prod.activationScript; | ||
34 | system.extraSystemBuilderCmds = '' | ||
35 | mkdir -p $out/webapps | ||
36 | ln -s ${chloe_prod.app.webRoot} $out/webapps/${chloe_prod.apache.webappName} | ||
37 | ''; | ||
38 | services.websites.production.modules = chloe_prod.apache.modules; | ||
39 | services.websites.production.vhostConfs.chloe = { | ||
40 | certName = "chloe"; | ||
41 | certMainHost = "osteopathe-cc.fr"; | ||
42 | hosts = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ]; | ||
43 | root = chloe_prod.apache.root; | ||
44 | extraConfig = [ chloe_prod.apache.vhostConf ]; | ||
45 | }; | ||
46 | }) | ||
47 | (lib.mkIf cfg.integration.enable { | ||
48 | secrets.keys = chloe_dev.keys; | ||
49 | services.myPhpfpm.serviceDependencies.chloe_dev = chloe_dev.phpFpm.serviceDeps; | ||
50 | services.myPhpfpm.poolConfigs.chloe_dev = chloe_dev.phpFpm.pool; | ||
51 | services.myPhpfpm.poolPhpConfigs.chloe_dev = '' | ||
52 | extension=${pkgs.php}/lib/php/extensions/mysqli.so | ||
53 | ''; | ||
54 | system.activationScripts.chloe_dev = chloe_dev.activationScript; | ||
55 | system.extraSystemBuilderCmds = '' | ||
56 | mkdir -p $out/webapps | ||
57 | ln -s ${chloe_dev.app.webRoot} $out/webapps/${chloe_dev.apache.webappName} | ||
58 | ''; | ||
59 | services.websites.integration.modules = chloe_dev.apache.modules; | ||
60 | services.websites.integration.vhostConfs.chloe = { | ||
61 | certName = "eldiron"; | ||
62 | addToCerts = true; | ||
63 | hosts = ["chloe.immae.eu" ]; | ||
64 | root = chloe_dev.apache.root; | ||
65 | extraConfig = [ chloe_dev.apache.vhostConf ]; | ||
66 | }; | ||
67 | }) | ||
68 | ]; | ||
69 | } | ||