]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Move Apache theme to pkgs
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 12 May 2019 13:27:47 +0000 (15:27 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 12 May 2019 15:40:04 +0000 (17:40 +0200)
74 files changed:
nixops/modules/websites/default.nix
pkgs/webapps/apache-theme/default.nix [new file with mode: 0644]
pkgs/webapps/apache-theme/theme/.htaccess [moved from nixops/modules/websites/apache/theme/.htaccess with 100% similarity]
pkgs/webapps/apache-theme/theme/footer.html [moved from nixops/modules/websites/apache/theme/footer.html with 100% similarity]
pkgs/webapps/apache-theme/theme/header.html [moved from nixops/modules/websites/apache/theme/header.html with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/archive.png [moved from nixops/modules/websites/apache/theme/icons/archive.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/audio.png [moved from nixops/modules/websites/apache/theme/icons/audio.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/authors.png [moved from nixops/modules/websites/apache/theme/icons/authors.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/bin.png [moved from nixops/modules/websites/apache/theme/icons/bin.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/blank.png [moved from nixops/modules/websites/apache/theme/icons/blank.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/bmp.png [moved from nixops/modules/websites/apache/theme/icons/bmp.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/c.png [moved from nixops/modules/websites/apache/theme/icons/c.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/calc.png [moved from nixops/modules/websites/apache/theme/icons/calc.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/cd.png [moved from nixops/modules/websites/apache/theme/icons/cd.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/copying.png [moved from nixops/modules/websites/apache/theme/icons/copying.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/cpp.png [moved from nixops/modules/websites/apache/theme/icons/cpp.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/css.png [moved from nixops/modules/websites/apache/theme/icons/css.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/deb.png [moved from nixops/modules/websites/apache/theme/icons/deb.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/default.png [moved from nixops/modules/websites/apache/theme/icons/default.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/diff.png [moved from nixops/modules/websites/apache/theme/icons/diff.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/doc.png [moved from nixops/modules/websites/apache/theme/icons/doc.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/draw.png [moved from nixops/modules/websites/apache/theme/icons/draw.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/eps.png [moved from nixops/modules/websites/apache/theme/icons/eps.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/exe.png [moved from nixops/modules/websites/apache/theme/icons/exe.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/folder-home.png [moved from nixops/modules/websites/apache/theme/icons/folder-home.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/folder-open.png [moved from nixops/modules/websites/apache/theme/icons/folder-open.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/folder-page.png [moved from nixops/modules/websites/apache/theme/icons/folder-page.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/folder-parent-old.png [moved from nixops/modules/websites/apache/theme/icons/folder-parent-old.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/folder-parent.png [moved from nixops/modules/websites/apache/theme/icons/folder-parent.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/folder.png [moved from nixops/modules/websites/apache/theme/icons/folder.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/gif.png [moved from nixops/modules/websites/apache/theme/icons/gif.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/gzip.png [moved from nixops/modules/websites/apache/theme/icons/gzip.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/h.png [moved from nixops/modules/websites/apache/theme/icons/h.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/hpp.png [moved from nixops/modules/websites/apache/theme/icons/hpp.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/html.png [moved from nixops/modules/websites/apache/theme/icons/html.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/ico.png [moved from nixops/modules/websites/apache/theme/icons/ico.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/image.png [moved from nixops/modules/websites/apache/theme/icons/image.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/install.png [moved from nixops/modules/websites/apache/theme/icons/install.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/java.png [moved from nixops/modules/websites/apache/theme/icons/java.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/jpg.png [moved from nixops/modules/websites/apache/theme/icons/jpg.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/js.png [moved from nixops/modules/websites/apache/theme/icons/js.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/json.png [moved from nixops/modules/websites/apache/theme/icons/json.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/log.png [moved from nixops/modules/websites/apache/theme/icons/log.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/makefile.png [moved from nixops/modules/websites/apache/theme/icons/makefile.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/markdown.png [moved from nixops/modules/websites/apache/theme/icons/markdown.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/package.png [moved from nixops/modules/websites/apache/theme/icons/package.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/pdf.png [moved from nixops/modules/websites/apache/theme/icons/pdf.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/php.png [moved from nixops/modules/websites/apache/theme/icons/php.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/playlist.png [moved from nixops/modules/websites/apache/theme/icons/playlist.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/png.png [moved from nixops/modules/websites/apache/theme/icons/png.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/pres.png [moved from nixops/modules/websites/apache/theme/icons/pres.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/ps.png [moved from nixops/modules/websites/apache/theme/icons/ps.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/psd.png [moved from nixops/modules/websites/apache/theme/icons/psd.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/py.png [moved from nixops/modules/websites/apache/theme/icons/py.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/rar.png [moved from nixops/modules/websites/apache/theme/icons/rar.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/rb.png [moved from nixops/modules/websites/apache/theme/icons/rb.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/readme.png [moved from nixops/modules/websites/apache/theme/icons/readme.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/rpm.png [moved from nixops/modules/websites/apache/theme/icons/rpm.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/rss.png [moved from nixops/modules/websites/apache/theme/icons/rss.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/rtf.png [moved from nixops/modules/websites/apache/theme/icons/rtf.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/script.png [moved from nixops/modules/websites/apache/theme/icons/script.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/source.png [moved from nixops/modules/websites/apache/theme/icons/source.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/sql.png [moved from nixops/modules/websites/apache/theme/icons/sql.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/tar.png [moved from nixops/modules/websites/apache/theme/icons/tar.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/tex.png [moved from nixops/modules/websites/apache/theme/icons/tex.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/text.png [moved from nixops/modules/websites/apache/theme/icons/text.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/tiff.png [moved from nixops/modules/websites/apache/theme/icons/tiff.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/unknown.png [moved from nixops/modules/websites/apache/theme/icons/unknown.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/vcal.png [moved from nixops/modules/websites/apache/theme/icons/vcal.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/video.png [moved from nixops/modules/websites/apache/theme/icons/video.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/xml.png [moved from nixops/modules/websites/apache/theme/icons/xml.png with 100% similarity]
pkgs/webapps/apache-theme/theme/icons/zip.png [moved from nixops/modules/websites/apache/theme/icons/zip.png with 100% similarity]
pkgs/webapps/apache-theme/theme/style.css [moved from nixops/modules/websites/apache/theme/style.css with 100% similarity]
pkgs/webapps/default.nix

index 7ed00db014a4efa86a3e3cbf9cdf4e2d982a9ca2..891d917467a1672805b3d4e395fe5e54ad4ed245 100644 (file)
@@ -305,88 +305,7 @@ in
         '';
       };
       apaxy = {
-        extraConfig = ''
-          <Macro Apaxy %{folder} %{ignored}>
-            Alias /theme ${theme_root}
-            <Directory ${theme_root}>
-              Options -Indexes
-              AllowOverride None
-              Require all granted
-            </Directory>
-
-            # mod_autoindex
-            <Directory %{folder}>
-              Options Indexes
-              AllowOverride None
-              Require all granted
-
-              # Inspired from Apaxy by @adamwhitcroft
-
-              IndexOptions +Charset=UTF-8 +FancyIndexing +IgnoreCase +FoldersFirst +XHTML +HTMLTable +SuppressRules +SuppressDescription +NameWidth=* +IconsAreLinks +ShowForbidden
-
-              IndexHeadInsert "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />"
-
-              IndexIgnoreReset ON
-              IndexIgnore /theme .htaccess %{ignored}
-
-              AddIcon /theme/icons/blank.png ^^BLANKICON^^
-              AddIcon /theme/icons/folder.png ^^DIRECTORY^^
-              AddIcon /theme/icons/folder-home.png ..
-
-              AddIconByType (TXT,/theme/icons/text.png) text/*
-              AddIconByType (IMG,/theme/icons/image.png) image/*
-              AddIconByType (SND,/theme/icons/audio.png) audio/*
-              AddIconByType (VID,/theme/icons/video.png) video/*
-
-              AddIcon /theme/icons/archive.png .7z .bz2 .cab .gz .tar
-              AddIcon /theme/icons/audio.png .aac .aif .aifc .aiff .ape .au .flac .iff .m4a .mid .mp3 .mpa .ra .wav .wma .f4a .f4b .oga .ogg .xm .it .s3m .mod
-              AddIcon /theme/icons/bin.png .bin .hex
-              AddIcon /theme/icons/bmp.png .bmp
-              AddIcon /theme/icons/c.png .c
-              AddIcon /theme/icons/calc.png .xlsx .xlsm .xltx .xltm .xlam .xlr .xls .csv
-              AddIcon /theme/icons/cd.png .iso
-              AddIcon /theme/icons/cpp.png .cpp
-              AddIcon /theme/icons/css.png .css .sass .scss
-              AddIcon /theme/icons/deb.png .deb
-              AddIcon /theme/icons/doc.png .doc .docx .docm .dot .dotx .dotm .log .msg .odt .pages .rtf .tex .wpd .wps
-              AddIcon /theme/icons/draw.png .svg .svgz
-              AddIcon /theme/icons/eps.png .ai .eps
-              AddIcon /theme/icons/exe.png .exe
-              AddIcon /theme/icons/gif.png .gif
-              AddIcon /theme/icons/h.png .h
-              AddIcon /theme/icons/html.png .html .xhtml .shtml .htm .URL .url
-              AddIcon /theme/icons/ico.png .ico
-              AddIcon /theme/icons/java.png .jar
-              AddIcon /theme/icons/jpg.png .jpg .jpeg .jpe
-              AddIcon /theme/icons/js.png .js .json
-              AddIcon /theme/icons/markdown.png .md
-              AddIcon /theme/icons/package.png .pkg .dmg
-              AddIcon /theme/icons/pdf.png .pdf
-              AddIcon /theme/icons/php.png .php .phtml
-              AddIcon /theme/icons/playlist.png .m3u .m3u8 .pls .pls8
-              AddIcon /theme/icons/png.png .png
-              AddIcon /theme/icons/ps.png .ps
-              AddIcon /theme/icons/psd.png .psd
-              AddIcon /theme/icons/py.png .py
-              AddIcon /theme/icons/rar.png .rar
-              AddIcon /theme/icons/rb.png .rb
-              AddIcon /theme/icons/rpm.png .rpm
-              AddIcon /theme/icons/rss.png .rss
-              AddIcon /theme/icons/script.png .bat .cmd .sh
-              AddIcon /theme/icons/sql.png .sql
-              AddIcon /theme/icons/tiff.png .tiff .tif
-              AddIcon /theme/icons/text.png .txt .nfo
-              AddIcon /theme/icons/video.png .asf .asx .avi .flv .mkv .mov .mp4 .mpg .rm .srt .swf .vob .wmv .m4v .f4v .f4p .ogv
-              AddIcon /theme/icons/xml.png .xml
-              AddIcon /theme/icons/zip.png .zip
-              DefaultIcon /theme/icons/default.png
-
-              HeaderName /theme/header.html
-              ReadmeName /theme/footer.html
-              IndexStyleSheet /theme/style.css
-            </Directory>
-          </Macro>
-        '';
+        extraConfig = (pkgs.webapps.apache-theme.override { inherit theme_root; }).apacheConfig;
       };
       http2 = {
         modules = [ "http2" ];
@@ -418,7 +337,7 @@ in
     in ''
       mkdir -p $out/webapps
       ln -s ${../../www} $out/webapps/_www
-      ln -s ${./apache/theme} $out/webapps/_theme
+      ln -s ${pkgs.webapps.apache-theme.theme} $out/webapps/_theme
       ln -s ${adminer.webRoot} $out/webapps/${adminer.apache.webappName}
       '';
 
diff --git a/pkgs/webapps/apache-theme/default.nix b/pkgs/webapps/apache-theme/default.nix
new file mode 100644 (file)
index 0000000..b679afe
--- /dev/null
@@ -0,0 +1,86 @@
+{ theme_root ? null }:
+rec {
+  theme = ./theme;
+  apacheConfig = ''
+    <Macro Apaxy %{folder} %{ignored}>
+      Alias /theme ${if isNull theme_root then theme else theme_root}
+      <Directory ${if isNull theme_root then theme else theme_root}>
+        Options -Indexes
+        AllowOverride None
+        Require all granted
+      </Directory>
+
+      # mod_autoindex
+      <Directory %{folder}>
+        Options Indexes
+        AllowOverride None
+        Require all granted
+
+        # Inspired from Apaxy by @adamwhitcroft
+
+        IndexOptions +Charset=UTF-8 +FancyIndexing +IgnoreCase +FoldersFirst +XHTML +HTMLTable +SuppressRules +SuppressDescription +NameWidth=* +IconsAreLinks +ShowForbidden
+
+        IndexHeadInsert "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />"
+
+        IndexIgnoreReset ON
+        IndexIgnore /theme .htaccess %{ignored}
+
+        AddIcon /theme/icons/blank.png ^^BLANKICON^^
+        AddIcon /theme/icons/folder.png ^^DIRECTORY^^
+        AddIcon /theme/icons/folder-home.png ..
+
+        AddIconByType (TXT,/theme/icons/text.png) text/*
+        AddIconByType (IMG,/theme/icons/image.png) image/*
+        AddIconByType (SND,/theme/icons/audio.png) audio/*
+        AddIconByType (VID,/theme/icons/video.png) video/*
+
+        AddIcon /theme/icons/archive.png .7z .bz2 .cab .gz .tar
+        AddIcon /theme/icons/audio.png .aac .aif .aifc .aiff .ape .au .flac .iff .m4a .mid .mp3 .mpa .ra .wav .wma .f4a .f4b .oga .ogg .xm .it .s3m .mod
+        AddIcon /theme/icons/bin.png .bin .hex
+        AddIcon /theme/icons/bmp.png .bmp
+        AddIcon /theme/icons/c.png .c
+        AddIcon /theme/icons/calc.png .xlsx .xlsm .xltx .xltm .xlam .xlr .xls .csv
+        AddIcon /theme/icons/cd.png .iso
+        AddIcon /theme/icons/cpp.png .cpp
+        AddIcon /theme/icons/css.png .css .sass .scss
+        AddIcon /theme/icons/deb.png .deb
+        AddIcon /theme/icons/doc.png .doc .docx .docm .dot .dotx .dotm .log .msg .odt .pages .rtf .tex .wpd .wps
+        AddIcon /theme/icons/draw.png .svg .svgz
+        AddIcon /theme/icons/eps.png .ai .eps
+        AddIcon /theme/icons/exe.png .exe
+        AddIcon /theme/icons/gif.png .gif
+        AddIcon /theme/icons/h.png .h
+        AddIcon /theme/icons/html.png .html .xhtml .shtml .htm .URL .url
+        AddIcon /theme/icons/ico.png .ico
+        AddIcon /theme/icons/java.png .jar
+        AddIcon /theme/icons/jpg.png .jpg .jpeg .jpe
+        AddIcon /theme/icons/js.png .js .json
+        AddIcon /theme/icons/markdown.png .md
+        AddIcon /theme/icons/package.png .pkg .dmg
+        AddIcon /theme/icons/pdf.png .pdf
+        AddIcon /theme/icons/php.png .php .phtml
+        AddIcon /theme/icons/playlist.png .m3u .m3u8 .pls .pls8
+        AddIcon /theme/icons/png.png .png
+        AddIcon /theme/icons/ps.png .ps
+        AddIcon /theme/icons/psd.png .psd
+        AddIcon /theme/icons/py.png .py
+        AddIcon /theme/icons/rar.png .rar
+        AddIcon /theme/icons/rb.png .rb
+        AddIcon /theme/icons/rpm.png .rpm
+        AddIcon /theme/icons/rss.png .rss
+        AddIcon /theme/icons/script.png .bat .cmd .sh
+        AddIcon /theme/icons/sql.png .sql
+        AddIcon /theme/icons/tiff.png .tiff .tif
+        AddIcon /theme/icons/text.png .txt .nfo
+        AddIcon /theme/icons/video.png .asf .asx .avi .flv .mkv .mov .mp4 .mpg .rm .srt .swf .vob .wmv .m4v .f4v .f4p .ogv
+        AddIcon /theme/icons/xml.png .xml
+        AddIcon /theme/icons/zip.png .zip
+        DefaultIcon /theme/icons/default.png
+
+        HeaderName /theme/header.html
+        ReadmeName /theme/footer.html
+        IndexStyleSheet /theme/style.css
+      </Directory>
+    </Macro>
+  '';
+}
index 229609f6b3ee0d67e3f146e3de2de6d5c6e0d401..8151b8d4f4ffa809b9b3c9cde387485c69769461 100644 (file)
@@ -1,6 +1,7 @@
 { callPackage, mylibs, composerEnv, lib }:
 rec {
   adminer = callPackage ./adminer {};
+  apache-theme = callPackage ./apache-theme {};
   awl = callPackage ./awl {};
   davical = callPackage ./davical {};
   diaspora = callPackage ./diaspora { inherit mylibs; };