userdir, zsh fixes

This commit is contained in:
quitte 2023-09-20 14:07:50 +02:00
parent 7043532749
commit e739a60e66
2 changed files with 13 additions and 13 deletions

View file

@ -1,4 +1,4 @@
{ config, ... }: { config, pkgs, ... }:
let let
domain = "users.${config.networking.domain}"; domain = "users.${config.networking.domain}";
port = 8083; port = 8083;
@ -18,18 +18,19 @@ in
mkdir -p $HOME/public_html mkdir -p $HOME/public_html
# public_html dir: apache and $USER have rwx on everything inside # 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 fi
''; '';
services.httpd = { services.httpd = {
enable = true; enable = true;
enablePHP = true; enablePHP = true;
extraModules = [ "userdir" ];
virtualHosts.${domain} = { virtualHosts.${domain} = {
enableUserDir = true;
extraConfig = '' extraConfig = ''
UserDir /home/users/*/public_html UserDir disabled root
UserDir /home/users/*/public_html/
<Directory "/home/users/*/public_html"> <Directory "/home/users/*/public_html">
Options -Indexes +MultiViews +SymLinksIfOwnerMatch +IncludesNoExec Options -Indexes +MultiViews +SymLinksIfOwnerMatch +IncludesNoExec
DirectoryIndex index.php index.html DirectoryIndex index.php index.html
@ -55,6 +56,10 @@ in
locations."/" = { locations."/" = {
proxyPass = "http://localhost:${toString port}"; proxyPass = "http://localhost:${toString port}";
extraConfig = ''
proxy_intercept_errors on;
error_page 403 404 =404 /404.html;
'';
}; };
}; };
} }

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { lib, pkgs, ... }:
{ {
programs.command-not-found.enable = false; programs.command-not-found.enable = false;
programs.nix-index-database.comma.enable = true; programs.nix-index-database.comma.enable = true;
@ -12,19 +12,14 @@
}; };
programs.zsh = { programs.zsh = {
enable = true; enable = true;
shellAliases = {
l = "ls -l";
ll = "ls -la";
la = "ls -a";
less = "bat";
};
histSize = 100000;
histFile = "~/.local/share/zsh/history";
autosuggestions = { autosuggestions = {
enable = true; enable = true;
highlightStyle = "fg=#00bbbb,bold"; highlightStyle = "fg=#00bbbb,bold";
}; };
# don't override agdsn-zsh-config aliases
shellAliases = lib.mkForce {};
shellInit = '' shellInit = ''
zsh-newuser-install () {} zsh-newuser-install () {}
''; '';