]> git.immae.eu Git - perso/Immae/Config/Nix/NUR.git/blob - pkgs/webapps/apache-theme/default.nix
Initial commit published for NUR
[perso/Immae/Config/Nix/NUR.git] / pkgs / webapps / apache-theme / default.nix
1 { theme_root ? null }:
2 rec {
3 theme = ./theme;
4 apacheConfig = let
5 theme_root' = if isNull theme_root then theme else theme_root;
6 in ''
7 <Macro Apaxy %{folder} %{ignored}>
8 Alias /theme ${theme_root'}
9 <Directory ${theme_root'}>
10 Options -Indexes
11 AllowOverride None
12 Require all granted
13 </Directory>
14
15 # mod_autoindex
16 <Directory %{folder}>
17 Options Indexes
18 AllowOverride None
19 Require all granted
20
21 # Inspired from Apaxy by @adamwhitcroft
22
23 IndexOptions +Charset=UTF-8 +FancyIndexing +IgnoreCase +FoldersFirst +XHTML +HTMLTable +SuppressRules +SuppressDescription +NameWidth=* +IconsAreLinks +ShowForbidden
24
25 IndexHeadInsert "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />"
26
27 IndexIgnoreReset ON
28 IndexIgnore /theme .htaccess %{ignored}
29
30 AddIcon /theme/icons/blank.png ^^BLANKICON^^
31 AddIcon /theme/icons/folder.png ^^DIRECTORY^^
32 AddIcon /theme/icons/folder-home.png ..
33
34 AddIconByType (TXT,/theme/icons/text.png) text/*
35 AddIconByType (IMG,/theme/icons/image.png) image/*
36 AddIconByType (SND,/theme/icons/audio.png) audio/*
37 AddIconByType (VID,/theme/icons/video.png) video/*
38
39 AddIcon /theme/icons/archive.png .7z .bz2 .cab .gz .tar
40 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
41 AddIcon /theme/icons/bin.png .bin .hex
42 AddIcon /theme/icons/bmp.png .bmp
43 AddIcon /theme/icons/c.png .c
44 AddIcon /theme/icons/calc.png .xlsx .xlsm .xltx .xltm .xlam .xlr .xls .csv
45 AddIcon /theme/icons/cd.png .iso
46 AddIcon /theme/icons/cpp.png .cpp
47 AddIcon /theme/icons/css.png .css .sass .scss
48 AddIcon /theme/icons/deb.png .deb
49 AddIcon /theme/icons/doc.png .doc .docx .docm .dot .dotx .dotm .log .msg .odt .pages .rtf .tex .wpd .wps
50 AddIcon /theme/icons/draw.png .svg .svgz
51 AddIcon /theme/icons/eps.png .ai .eps
52 AddIcon /theme/icons/exe.png .exe
53 AddIcon /theme/icons/gif.png .gif
54 AddIcon /theme/icons/h.png .h
55 AddIcon /theme/icons/html.png .html .xhtml .shtml .htm .URL .url
56 AddIcon /theme/icons/ico.png .ico
57 AddIcon /theme/icons/java.png .jar
58 AddIcon /theme/icons/jpg.png .jpg .jpeg .jpe
59 AddIcon /theme/icons/js.png .js .json
60 AddIcon /theme/icons/markdown.png .md
61 AddIcon /theme/icons/package.png .pkg .dmg
62 AddIcon /theme/icons/pdf.png .pdf
63 AddIcon /theme/icons/php.png .php .phtml
64 AddIcon /theme/icons/playlist.png .m3u .m3u8 .pls .pls8
65 AddIcon /theme/icons/png.png .png
66 AddIcon /theme/icons/ps.png .ps
67 AddIcon /theme/icons/psd.png .psd
68 AddIcon /theme/icons/py.png .py
69 AddIcon /theme/icons/rar.png .rar
70 AddIcon /theme/icons/rb.png .rb
71 AddIcon /theme/icons/rpm.png .rpm
72 AddIcon /theme/icons/rss.png .rss
73 AddIcon /theme/icons/script.png .bat .cmd .sh
74 AddIcon /theme/icons/sql.png .sql
75 AddIcon /theme/icons/tiff.png .tiff .tif
76 AddIcon /theme/icons/text.png .txt .nfo
77 AddIcon /theme/icons/video.png .asf .asx .avi .flv .mkv .mov .mp4 .mpg .rm .srt .swf .vob .wmv .m4v .f4v .f4p .ogv
78 AddIcon /theme/icons/xml.png .xml
79 AddIcon /theme/icons/zip.png .zip
80 DefaultIcon /theme/icons/default.png
81
82 HeaderName /theme/header.html
83 ReadmeName /theme/footer.html
84 IndexStyleSheet /theme/style.css
85 </Directory>
86 </Macro>
87 '';
88 }