Compare commits

..

6 Commits

Author SHA1 Message Date
h7x4
9c142fd56f kommode/gitea: remove deprecated config options 2026-05-11 16:00:51 +09:00
Øystein Tveit
b98e8679e6 temmie/userweb: set same phpOptions for env and apache 2026-05-11 14:54:56 +09:00
h7x4
ea092ec0b3 temmie/userweb: pass userdir user to sendmail through custom envvar 2026-05-11 14:26:47 +09:00
h7x4
5e50b617fb temmie/userweb: switch from postfix to nullmailer 2026-05-11 13:52:58 +09:00
h7x4
258c5a7b25 temmie/userweb: set up sendmail wrapper 2026-05-11 12:26:39 +09:00
h7x4
b9eda3dc56 temmie/userweb: reduce package list 2026-05-11 10:17:09 +09:00
4 changed files with 78 additions and 75 deletions

View File

@@ -134,9 +134,6 @@ in {
ALLOW_FORK_INTO_SAME_OWNER = true;
};
picture = {
DISABLE_GRAVATAR = true;
ENABLE_FEDERATED_AVATAR = false;
AVATAR_MAX_FILE_SIZE = 1024 * 1024 * 5;
# NOTE: go any bigger than this, and gitea will freeze your gif >:(
AVATAR_MAX_ORIGIN_SIZE = 1024 * 1024 * 2;

View File

@@ -6,7 +6,7 @@
(fp /base)
./services/nfs-mounts.nix
./services/userweb.nix
./services/userweb
];
systemd.network.networks."30-ens18" = values.defaultNetworkConfig // {

View File

@@ -4,6 +4,13 @@ let
homeLetters = [ "a" "b" "c" "d" "h" "i" "j" "k" "l" "m" "z" ];
phpOptions = lib.concatStringsSep "\n" (lib.mapAttrsToList (k: v: "${k} = ${v}"){
display_errors = "Off";
display_startup_errors = "Off";
post_max_size = "40M";
upload_max_filesize = "40M";
});
# https://nixos.org/manual/nixpkgs/stable/#ssec-php-user-guide-installing-with-extensions
phpEnv = pkgs.php.buildEnv {
extensions = { all, ... }: with all; [
@@ -16,8 +23,7 @@ let
mysqlnd
pgsql
posix
protobuf
sqlite3
protobuf sqlite3
uuid
xml
xsl
@@ -30,11 +36,7 @@ let
pdo_sqlite
];
extraConfig = ''
display_errors=0
post_max_size = 40M
upload_max_filesize = 40M
'';
extraConfig = phpOptions;
};
perlEnv = pkgs.perl.withPackages (ps: with ps; [
@@ -65,6 +67,21 @@ let
ignoreCollisions = true;
};
sendmailWrapper = pkgs.writeShellApplication {
name = "sendmail";
runtimeInputs = [ ];
text = ''
args=("$@")
if [[ -z "$USERDIR_USER" ]] && [[ "$USERDIR_USER" != "pvv" ]]; then
# Prepend -fusername to the argument list, so bounces go to the user
args=("-f$USERDIR_USER" "''${args[@]}")
fi
exec '${lib.getExe pkgs.system-sendmail}' "''${args[@]}"
'';
};
# https://nixos.org/manual/nixpkgs/stable/#sec-building-environment
fhsEnv = pkgs.buildEnv {
name = "userweb-env";
@@ -72,6 +89,8 @@ let
paths = with pkgs; [
bash
sendmailWrapper
perlEnv
pythonEnv
phpEnv
@@ -80,87 +99,56 @@ let
# composer
])
++ [
# Useful packages for homepages
exiftool
gnuplot
ikiwiki-full
imagemagick
jhead
ruby
sbcl
sourceHighlight
# Missing packages from tom
# blosxom
# pyblosxom
# mediawiki (TODO: do people host their own mediawikis in userweb?)
# nanoblogger
# Version control
cvs
rcs
git
# Compression/Archival
bzip2
gnutar
gzip
lz4
unzip
xz
zip
zstd
# Other tools you might expect to find on a normal system
acl
aspell
autoconf
autotrash
bazel
bintools
bison
bsd-finger
catdoc
ccache
clang
cmake
coreutils-full
curl
devcontainer
diffutils
emacs
# exiftags
exiftool
ffmpeg
file
findutils
gawk
gcc
glibc
gnugrep
gnumake
gnupg
gnuplot
gnused
gnutar
gzip
html-tidy
imagemagick
inetutils
iproute2
jhead
less
libgcc
lndir
mailutils
man # TODO: does this one want a mandb instance?
meson
more
mpc
mpi
mplayer
ninja
nix
openssh
openssl
patchelf
pkg-config
ppp
procmail
procps
qemu
rc
rhash
rsync
ruby # TODO: does this one want systemwide packages?
salt
sccache
sourceHighlight
spamassassin
strace
subversion
system-sendmail
systemdMinimal
texliveMedium
tmux
unzip
man
util-linux
valgrind
vim
wget
which
wine
xdg-utils
zip
zstd
];
extraOutputsToInstall = [
@@ -170,6 +158,10 @@ let
};
in
{
imports = [
./mail.nix
];
services.httpd = {
enable = true;
adminAddr = "drift@pvv.ntnu.no";
@@ -184,6 +176,7 @@ in
enablePHP = true;
phpPackage = phpEnv;
inherit phpOptions;
enablePerl = true;
@@ -220,6 +213,7 @@ in
UserDir disabled root
AddHandler cgi-script .cgi
DirectoryIndex index.html index.html.var index.php index.php3 index.cgi index.phtml index.shtml meg.html
SetEnvIf Request_URI "^/~([^/]+)" USERDIR_USER=$1
<Directory "/home/pvv/?/*/web-docs">
Options MultiViews Indexes SymLinksIfOwnerMatch ExecCGI IncludesNoExec

View File

@@ -0,0 +1,12 @@
{ config, lib, ... }:
{
services.postfix.enable = lib.mkForce false;
services.nullmailer = {
enable = true;
config = {
me = config.networking.fqdn;
remotes = "mail.pvv.ntnu.no smtp --port=25";
};
};
}