aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/tools/assets/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/private/websites/tools/assets/default.nix')
-rw-r--r--modules/private/websites/tools/assets/default.nix39
1 files changed, 0 insertions, 39 deletions
diff --git a/modules/private/websites/tools/assets/default.nix b/modules/private/websites/tools/assets/default.nix
deleted file mode 100644
index 0eb476d..0000000
--- a/modules/private/websites/tools/assets/default.nix
+++ /dev/null
@@ -1,39 +0,0 @@
1{ lib, pkgs, config, ... }:
2let
3 cfg = config.myServices.websites.tools.assets;
4 assets_urls = lib.mapAttrs (k: v: pkgs.fetchurl v) config.myEnv.tools.assets;
5 assets = pkgs.runCommand "assets" {} (''
6 mkdir -p $out
7 cp -a ${./static}/* $out/
8 '' + builtins.concatStringsSep "\n"
9 (lib.mapAttrsToList (k: v: ''
10 install -D -m644 -T ${v} $out/${k}
11 '') assets_urls));
12in
13{
14 options.myServices.websites.tools.assets = {
15 enable = lib.mkEnableOption "Enable assets website";
16 };
17 config = lib.mkIf cfg.enable {
18 services.websites.env.tools.vhostConfs.assets = {
19 certName = "eldiron";
20 addToCerts = true;
21 hosts = [ "assets.immae.eu" ];
22 root = assets;
23 extraConfig = [
24 ''
25 Use Apaxy "${assets}" "title"
26 <Directory "${assets}">
27 Options Indexes FollowSymlinks
28 AllowOverride None
29 Require all granted
30 Header always set Last-Modified "Tue, 01 Jan 2020 00:00:00 GMT"
31 Header always set Cache-Control "public, max-age=31536000, immutable"
32 Header always set Access-Control-Allow-Origin "*"
33 Header always set Access-Control-Expose-Headers "*"
34 </Directory>
35 ''
36 ];
37 };
38 };
39}