diff --git a/modules/services/web-servers/lighttpd/default.nix b/modules/services/web-servers/lighttpd/default.nix index 326ed76bd40..588fece257e 100644 --- a/modules/services/web-servers/lighttpd/default.nix +++ b/modules/services/web-servers/lighttpd/default.nix @@ -36,6 +36,11 @@ let static-file.exclude-extensions = ( ".fcgi", ".php", ".rb", "~", ".inc" ) index-file.names = ( "index.html" ) + ${if cfg.mod_userdir then '' + server.modules += ("mod_userdir") + userdir.path = "public_html" + '' else ""} + ${cfg.extraConfig} ''; @@ -71,6 +76,15 @@ in ''; }; + mod_userdir = mkOption { + default = false; + type = types.uniq types.bool; + description = '' + If true, requests in the form /~user/page.html are rewritten to take + the file public_html/page.html from the home directory of the user. + ''; + }; + configText = mkOption { default = ""; type = types.string;