diff --git a/modules/userdir.nix b/modules/userdir.nix index 16a8d27..592320d 100644 --- a/modules/userdir.nix +++ b/modules/userdir.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ config, pkgs, ... }: let domain = "users.${config.networking.domain}"; port = 8083; @@ -18,18 +18,19 @@ in mkdir -p $HOME/public_html # public_html dir: apache and $USER have rwx on everything inside - setfacl -m u:${apacheUser}:rwx,d:u:${apacheUser}:rwx,d:u:$USER:rwx $HOME/public_html + setfacl -m u:${apacheUser}:rwx,d:u:${apacheUser}:rwx,d:u:''${USER}:rwx $HOME/public_html fi ''; services.httpd = { enable = true; enablePHP = true; + extraModules = [ "userdir" ]; virtualHosts.${domain} = { - enableUserDir = true; extraConfig = '' - UserDir /home/users/*/public_html + UserDir disabled root + UserDir /home/users/*/public_html/ Options -Indexes +MultiViews +SymLinksIfOwnerMatch +IncludesNoExec DirectoryIndex index.php index.html @@ -55,6 +56,10 @@ in locations."/" = { proxyPass = "http://localhost:${toString port}"; + extraConfig = '' + proxy_intercept_errors on; + error_page 403 404 =404 /404.html; + ''; }; }; } diff --git a/modules/zsh.nix b/modules/zsh.nix index 3aafd18..f228a6d 100644 --- a/modules/zsh.nix +++ b/modules/zsh.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ lib, pkgs, ... }: { programs.command-not-found.enable = false; programs.nix-index-database.comma.enable = true; @@ -12,19 +12,14 @@ }; programs.zsh = { enable = true; - shellAliases = { - l = "ls -l"; - ll = "ls -la"; - la = "ls -a"; - less = "bat"; - }; - histSize = 100000; - histFile = "~/.local/share/zsh/history"; autosuggestions = { enable = true; highlightStyle = "fg=#00bbbb,bold"; }; + # don't override agdsn-zsh-config aliases + shellAliases = lib.mkForce {}; + shellInit = '' zsh-newuser-install () {} '';