mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-05-21 05:51:12 +02:00
Compare commits
6 Commits
2fcaf5893f
...
9c142fd56f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c142fd56f | ||
|
|
b98e8679e6 | ||
|
|
ea092ec0b3 | ||
|
|
5e50b617fb | ||
|
|
258c5a7b25 | ||
|
|
b9eda3dc56 |
@@ -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;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
(fp /base)
|
||||
|
||||
./services/nfs-mounts.nix
|
||||
./services/userweb.nix
|
||||
./services/userweb
|
||||
];
|
||||
|
||||
systemd.network.networks."30-ens18" = values.defaultNetworkConfig // {
|
||||
|
||||
@@ -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
|
||||
12
hosts/temmie/services/userweb/mail.nix
Normal file
12
hosts/temmie/services/userweb/mail.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user