summaryrefslogtreecommitdiffstats
path: root/lass
diff options
context:
space:
mode:
Diffstat (limited to 'lass')
-rw-r--r--lass/2configs/mail.nix11
-rw-r--r--lass/2configs/websites/default.nix26
-rw-r--r--lass/2configs/websites/domsen.nix1
-rw-r--r--lass/2configs/websites/fritz.nix1
-rw-r--r--lass/2configs/websites/lassulus.nix1
-rw-r--r--lass/3modules/static_nginx.nix78
6 files changed, 39 insertions, 79 deletions
diff --git a/lass/2configs/mail.nix b/lass/2configs/mail.nix
index fe82fea59..a90890aab 100644
--- a/lass/2configs/mail.nix
+++ b/lass/2configs/mail.nix
@@ -15,6 +15,10 @@ let
${pkgs.msmtp}/bin/msmtp -C ${msmtprc} "$@"
'';
+ mailcap = pkgs.writeText "mailcap" ''
+ text/html; ${pkgs.elinks}/bin/elinks -dump ; copiousoutput;
+ '';
+
muttrc = pkgs.writeText "muttrc" ''
# gpg
source ${pkgs.neomutt}/share/doc/mutt/samples/gpg.rc
@@ -37,6 +41,9 @@ let
<display-message><enter-command> set crypt_verify_sig=\$my_crypt_verify_sig<enter>" \
'Verify PGP signature'
+ # read html mails
+ auto_view text/html
+ set mailcap_path = ${mailcap}
# notmuch
set nm_default_uri="notmuch://$HOME/Maildir" # path to the maildir
@@ -59,7 +66,7 @@ let
recipent="$(echo $1 | sed 's/[^,]*<\([^>]*\)[^,]*/ \1/g')"
# output to mutt
# V
- echo "%4C %Z %?GI?%GI& ? %[%d/%b] %-20.20a %?M?(%3M)& ? %s %> $recipent %?g?%g?%"
+ echo "%4C %Z %?GI?%GI& ? %[%y-%m-%d] %-20.20a %?M?(%3M)& ? %s %> $recipent %?g?%g?%"
# args to mutt-index dash script
# V
''} %r |"
@@ -119,6 +126,8 @@ let
bind pager t noop
macro index t "<modify-labels>+TODO\n" # tag as Archived
+ # top index bar in email view
+ set pager_index_lines=7
# sidebar
set sidebar_width = 20
diff --git a/lass/2configs/websites/default.nix b/lass/2configs/websites/default.nix
new file mode 100644
index 000000000..1ffa105a7
--- /dev/null
+++ b/lass/2configs/websites/default.nix
@@ -0,0 +1,26 @@
+{ config, lib, ... }:
+
+with import <stockholm/lib>;
+
+{
+ services.nginx = {
+ recommendedGzipSettings = true;
+ recommendedOptimisation = true;
+ recommendedTlsSettings = true;
+
+ virtualHosts._http = {
+ default = true;
+ extraConfig = ''
+ return 404;
+ '';
+ };
+
+ virtualHosts.default = {
+ locations."= /etc/os-release".extraConfig = ''
+ default_type text/plain;
+ alias /etc/os-release;
+ '';
+ };
+ };
+}
+
diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix
index b0e5375c7..10ff142f9 100644
--- a/lass/2configs/websites/domsen.nix
+++ b/lass/2configs/websites/domsen.nix
@@ -23,6 +23,7 @@ let
in {
imports = [
+ ./default.nix
./sqlBackup.nix
(servePage [ "reich-gebaeudereinigung.de" "www.reich-gebaeudereinigung.de" ])
(servePage [
diff --git a/lass/2configs/websites/fritz.nix b/lass/2configs/websites/fritz.nix
index 45927b102..aa57a9857 100644
--- a/lass/2configs/websites/fritz.nix
+++ b/lass/2configs/websites/fritz.nix
@@ -26,6 +26,7 @@ in {
services.nginx.enable = true;
imports = [
+ ./default.nix
./sqlBackup.nix
(serveWordpress [ "radical-dreamers.de" "www.radical-dreamers.de" ])
diff --git a/lass/2configs/websites/lassulus.nix b/lass/2configs/websites/lassulus.nix
index 0771570ca..93b817c3b 100644
--- a/lass/2configs/websites/lassulus.nix
+++ b/lass/2configs/websites/lassulus.nix
@@ -8,6 +8,7 @@ let
in {
imports = [
+ ./default.nix
../git.nix
];
diff --git a/lass/3modules/static_nginx.nix b/lass/3modules/static_nginx.nix
deleted file mode 100644
index cd33a2cf1..000000000
--- a/lass/3modules/static_nginx.nix
+++ /dev/null
@@ -1,78 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-with import <stockholm/lib>;
-
-let
- cfg = config.lass.staticPage;
-
- out = {
- options.lass.staticPage = api;
- config = imp;
- };
-
- api = mkOption {
- type = with types; attrsOf (submodule ({ config, ... }: {
- options = {
- domain = mkOption {
- type = str;
- default = config._module.args.name;
- };
- folder = mkOption {
- type = str;
- default = "/srv/http/${config.domain}";
- };
- #sslEnable = mkEnableOption "ssl";
- #certificate = mkOption {
- # type = str;
- #};
- #certificate_key = mkOption {
- # type = str;
- #};
- #ciphers = mkOption {
- # type = str;
- # default = "AES128+EECDH:AES128+EDH";
- #};
- ssl = mkOption {
- type = with types; submodule ({
- options = {
- enable = mkEnableOption "ssl";
- certificate = mkOption {
- type = str;
- };
- certificate_key = mkOption {
- type = str;
- };
- };
- });
- default = {};
- };
- };
- }));
- default = {};
- };
-
- user = config.services.nginx.user;
- group = config.services.nginx.group;
-
- external-ip = config.krebs.build.host.nets.internet.ip4.addr;
-
- imp = {
- krebs.nginx.servers = flip mapAttrs cfg ( name: { domain, folder, ssl, ... }: {
- server-names = [
- "${domain}"
- "www.${domain}"
- ];
- locations = [
- (nameValuePair "/" ''
- root ${folder};
- '')
- (nameValuePair "~ /\\." ''
- deny all;
- '')
- ];
- inherit ssl;
-
- });
- };
-
-in out