78 Commits

Author SHA1 Message Date
stubbfel
7b102905c1 add guest agent 2025-12-09 19:40:08 +01:00
stubbfel
f7365ee194 fix gitea 2025-12-09 19:26:54 +01:00
stubbfel
99b7a30adb update to 202511 2025-12-09 18:24:58 +01:00
stubbfel
e96b7016bf add xkcd-pw 2025-06-15 20:49:22 +02:00
stubbfel
f08ff9e904 fix neues update 2025-06-09 15:43:27 +02:00
stubbfel
0fe0e94e55 tune nextcloud opc cahc config 2025-06-09 14:29:48 +02:00
stubbfel
598058bfb3 update to nixos 24.11 2024-12-02 19:21:36 +01:00
stubbfel
9f75a69752 update nexus 3.69 und nextcloud 2024-10-12 14:56:58 +02:00
stubbfel
7407a0e0cb update nexus 3.66 2024-03-11 22:24:42 +01:00
stubbfel
23211c1313 update nextcloud 28 2024-03-11 22:13:55 +01:00
stubbfel
0b86fda79a 23.11 2023-12-06 23:06:29 +01:00
stubbfel
49d220d025 update 2023-12-06 21:31:42 +01:00
stubbfel
fc6e443cff update 2023-08-13 14:00:01 +02:00
stubbfel
2e497f7479 fix gitea 2023-06-03 20:34:50 +02:00
stubbfel
0a98eb2a98 update 2023-06-03 17:51:40 +02:00
stubbfel
420a04671e update 2023-04-23 13:05:04 +02:00
stubbfel
6bd8185d78 update 2023-04-23 11:22:35 +02:00
stubbfel
b07529c39c update 22.11 2022-12-04 13:29:19 +01:00
stubbfel
0f1e7bcf67 renable nextcloud cron 2022-11-20 20:12:41 +01:00
stubbfel
c2a005a465 update nextloud 2022-11-19 19:15:41 +01:00
stubbfel
5b1b8e0d25 update 2022-11-19 13:15:50 +01:00
stubbfel
f229637562 update 2022-11-19 12:09:04 +01:00
stubbfel
5ad6cf7b17 update 22.05 2022-09-27 19:57:19 +02:00
stubbfelnewpc
120ba60838 add hydra 2022-09-27 19:39:54 +02:00
stubbfel
f11fcdae75 update unciv 2022-08-31 20:58:44 +02:00
stubbfelnewpc
60ea6ae9f8 add unciv module 2022-08-31 19:55:06 +02:00
stubbfel
0a05c931aa update nexus 2022-03-13 18:24:32 +01:00
stubbfel
8f539e653b rm steamcmd 2021-12-01 22:08:41 +01:00
stubbfel
84d5f16df9 update nexus 2021-12-01 20:29:16 +01:00
stubbfel
b56bf82fb4 rm unsed sevrices, limit build jobs 2021-11-28 13:31:31 +01:00
stubbfel
94725a6762 mailcow used acme ssl 2021-11-02 22:03:56 +01:00
stubbfel
132e0cf872 add mailcow 2021-10-20 02:51:48 +02:00
stubbfel
991e6d3e34 add occ, fix cron 2021-09-14 22:09:56 +02:00
stubbfel
99bfa7e8d9 add redis to nextcloud 2021-09-12 19:00:55 +02:00
stubbfel
358f6d38f1 try fix webfinger 2021-09-12 18:42:35 +02:00
stubbfel
8774c26529 fix nextcloud php 2021-09-12 18:07:22 +02:00
stubbfel
436e999ecb update to 21.05 2021-06-26 21:46:23 +02:00
stubbfel
c631788f8c add auto remove logs to sks 2021-05-13 22:48:30 +02:00
stubbfel
a82ef7825c update valheim server 2021-05-13 22:47:45 +02:00
stubbfelnewpc
4b4559d5a5 Merge branch 'master' of gitea.stubbe.rocks:nixos-config/stubbfelnix 2021-03-24 21:06:57 +01:00
stubbfelnewpc
8bf0145068 update Lostplaces world 2021-03-24 21:05:48 +01:00
stubbfel
79a49de52f Ad file as target package 2021-03-23 22:45:36 +01:00
stubbfel
85ac69fc5d fix vaheim 2021-03-23 22:07:51 +01:00
stubbfelnewpc
535e8323b1 fix vaheim 2021-03-23 22:04:19 +01:00
stubbfelnewpc
d0c273f638 add virtual plus 2021-03-23 22:02:40 +01:00
stubbfelnewpc
83660e400c enable vaheim 2021-03-23 21:48:47 +01:00
stubbfel
50f617abc7 disable news2 kindle 2021-01-24 15:06:17 +01:00
stubbfel
47f57e005f add jiitsi 2020-12-28 14:34:02 +01:00
stubbfel
6bfd763a72 update to 20.09 2020-12-23 18:13:26 +01:00
stubbfel
fd8a8e840a add pinbook key 2020-12-22 18:26:06 +01:00
stubbfelnewpc
836033ef1f enable wireguard 2020-10-29 00:01:15 +01:00
stubbfelnewpc
40ae08c3c9 fix nexus domain name 2020-10-24 19:17:41 +02:00
stubbfelnewpc
1857a002dd enable ssl for nexus 2020-10-24 19:16:04 +02:00
stubbfelnewpc
ea86e52edc add nexus , disable 7dtd 2020-10-24 19:09:39 +02:00
stubbfel
df37c6ae9f add mqtt server 2020-06-11 18:45:21 +02:00
stubbfel
d3c565b5fa add mqtt server 2020-06-11 18:45:01 +02:00
stubbfel
45cba0bdae fix news2kindle module, disable apsw tests 2020-06-11 18:43:17 +02:00
stubbfel
07cb96807f add mqtt server 2020-05-24 19:17:29 +02:00
stubbfel
e5335939c5 update 2020.3 2020-05-24 17:18:09 +02:00
stubbfel
8becdbf468 upgrade to 19.09 2019-10-27 19:10:18 +01:00
stubbfel
f4a16b2615 disable docker 2019-10-27 17:37:37 +01:00
stubbfel
a01e264bea Merge branch 'master' of gitea.stubbe.rocks:nixos-config/stubbfelnix 2019-10-27 17:09:44 +01:00
stubbfel
67c36a4cfd Revert "Merge branch 'master' of gitea.stubbe.rocks:nixos-config/stubbfelnix"
This reverts commit e9af41cf54, reversing
changes made to 2d0786d558.
2019-10-27 17:06:20 +01:00
stubbfel
e9af41cf54 Merge branch 'master' of gitea.stubbe.rocks:nixos-config/stubbfelnix 2019-10-27 17:01:16 +01:00
stubbfel
17e4e55c4e Merge branch 'master' of gitea.stubbe.rocks:nixos-config/stubbfelnix 2019-10-27 16:58:58 +01:00
stubbfel
2d0786d558 update teamspeak 2019-10-27 16:36:39 +01:00
stubbfel
21f3411181 Revert "„services/nextcloud.nix“ ändern"
This reverts commit f6ea2148f8.
2019-01-27 17:05:40 +01:00
stubbfel
f6ea2148f8 „services/nextcloud.nix“ ändern 2019-01-27 17:03:43 +01:00
stubbfel
ac45e5ca98 „services/nextcloud.nix“ ändern 2019-01-27 16:53:26 +01:00
stubbfel
183500b186 „users.nix“ ändern 2019-01-23 22:25:41 +01:00
stubbfel
68d66ae112 add repo path, to enable update the binar path inside the repo hooks 2018-12-21 16:52:19 +01:00
stubbfel
037f15e237 upgrade nixos, teamspeak nextcloud 2018-10-26 01:28:24 +02:00
stubbfel
3891bdca58 update gc 2018-10-25 20:47:52 +02:00
stubbfel
e0d60d3e70 pre upgrade config 2018-10-25 20:33:25 +02:00
stubbfel
81bbdc3757 fix ngnix 2018-08-18 21:30:12 +02:00
stubbfel
c5833f122e updaet nixloud to u13 2018-05-13 00:31:33 +02:00
stubbfel
ff0cd83287 add exa, progess tldr 2018-04-12 21:18:51 +02:00
stubbfel
4c61566465 uptade to nixos 18.03 2018-04-12 21:12:57 +02:00
32 changed files with 696 additions and 131 deletions

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "module/unciv"]
path = module/unciv
url = gitea@gitea.stubbe.rocks:nixos-config/unciv.git

View File

@@ -4,7 +4,7 @@
# Use the GRUB 2 boot loader.
boot.loader.grub = {
enable = true;
version = 2;
# version = 2;
device = "/dev/sda";
};
}

View File

@@ -14,13 +14,19 @@
./programs/installed.nix
./services/enabled.nix
./users.nix
./module/news2kindle/news2kindle.nix
# ./module/news2kindle/news2kindle.nix
# ./module/etherpad/etherpad.nix
];
services.qemuGuest.enable = true;
nixpkgs.config.allowUnfree = true;
nix.gc.automatic = true;
nix.gc.dates = "03:15";
nix.gc.options = "--delete-older-than 15d";
nix.settings.experimental-features = "nix-command flakes";
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
@@ -28,6 +34,18 @@
# should.
system = {
stateVersion = "17.09"; # Did you read the comment?
autoUpgrade.enable = true;
autoUpgrade = {
enable = true;
allowReboot = true;
flags = [
"--max-jobs"
"1"
"--builders"
"''"
];
};
};
security.acme.defaults.email = "stubbfel@posteo.de";
security.acme.acceptTerms = true;
}

View File

@@ -19,5 +19,5 @@
swapDevices = [ ];
nix.maxJobs = lib.mkDefault 6;
nix.settings.max-jobs = lib.mkDefault 6;
}

View File

@@ -2,10 +2,8 @@
{
# Select internationalisation properties.
i18n = {
consoleKeyMap = "de";
defaultLocale = "de_DE.UTF-8";
};
i18n.defaultLocale = "de_DE.UTF-8";
console.keyMap= "de";
# Set your time zone.
time.timeZone = "Europe/Amsterdam";

View File

@@ -59,11 +59,13 @@ jobs = concatMap(recipient: concatMap(cronjob:
["${cronjob.cronExpression} root bash ${script}"]) recipient.cronJobs) reps;
odfpyNoTest = pkgs.python2Packages.odfpy.overrideAttrs (oldAttrs: rec {
odfpyNoTest = pkgs.python38Packages.odfpy.overrideAttrs (oldAttrs: rec {
doInstallCheck = false;
});
apswNoTest = pkgs.python38Packages.apsw.overrideAttrs (oldAttrs: rec {
doInstallCheck = false;
});
calibreWithRecipes = pkgs.calibre.overrideAttrs (oldAttrs: rec {
installPhase = ''
@@ -71,10 +73,10 @@ calibreWithRecipes = pkgs.calibre.overrideAttrs (oldAttrs: rec {
cp -ravf recipes $out/var/news2kindle
''+ oldAttrs.installPhase ;
buildInputs = (remove pkgs.python2Packages.odfpy oldAttrs.buildInputs) ++ [odfpyNoTest];
buildInputs = (remove pkgs.python38Packages.apsw (remove pkgs.python38Packages.odfpy oldAttrs.buildInputs)) ++ [odfpyNoTest apswNoTest pkgs.python38Packages.feedparser pkgs.python38Packages.pyqt5];
# patches = oldAttrs.patches ++ [./calibre-disable_plugins.patch];
patches = [./calibre-disable_plugins.patch];
# patches = [./calibre-disable_plugins.patch];
});
@@ -163,7 +165,12 @@ in
###### implementation
config = mkIf cfg.enable{
environment.systemPackages = [pkgs.python27Packages.pyqt5 pkgs.python36Packages.pyqt5 pkgs.mailsend calibreWithRecipes];
environment.systemPackages = [
# pkgs.python27Packages.pyqt5
# pkgs.python36Packages.pyqt5
pkgs.mailsend
calibreWithRecipes
];
services.cron.enable = true;
services.cron.systemCronJobs = jobs;
};

1
module/unciv Submodule

Submodule module/unciv added at d211d67165

View File

@@ -1,8 +1,12 @@
{ config, pkgs, ... }:
let
unstable = import <nixos-unstable> { config = { allowUnfree = true; }; };
in
{
environment.systemPackages = with pkgs; [
wget curl vim nano zsh fzf tmux git
wget curl vim nano zsh fzf tmux git eza progress tldr htop unstable.docker-compose pkgs.php83 steamcmd helix
];
imports =

View File

@@ -1,19 +1,11 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
zsh-git-prompt
];
programs.zsh = {
enable = true;
enableAutosuggestions = true;
autosuggestions.enable = true;
enableCompletion = true;
syntaxHighlighting.enable = true;
interactiveShellInit = ''
source ${pkgs.zsh-git-prompt}/share/zsh-git-prompt/zshrc.sh
'';
};

42
services/7dtd.nix Normal file
View File

@@ -0,0 +1,42 @@
{ config, pkgs, ... }:
let
runEnv = (pkgs.buildFHSUserEnv {
name = "7dtd-env";
targetPkgs = pkgs: (with pkgs;
[
]);
runScript = "bash startserver.sh -configfile=serverconfig.xml";
});
in
{
networking.firewall.allowedTCPPorts = [26900];
networking.firewall.allowedUDPPorts = [26900 26901 26902];
#7DaysToDie.stubbe.rocks
# services.nginx.virtualHosts."7daystodie.stubbe.rocks" = {
# enableACME = true;
# forceSSL = false;
# locations."/".proxyPass = "http://localhost:8085";
# };
systemd.services.sdtd = {
description = "7dtd";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
User = "sshuser";
Group = "users";
WorkingDirectory = "/home/sshuser/SteamCMD7_Days_to_Die_server";
ExecStart = "${runEnv}/bin/7dtd-env";
Restart = "always";
};
};
}

8
services/docker.nix Normal file
View File

@@ -0,0 +1,8 @@
{ config, pkgs, ... }:
{
virtualisation.docker = {
enable = true;
enableOnBoot = true;
};
}

View File

@@ -3,14 +3,27 @@
{
imports =
[
#./7dtd.nix
# ./vaheim.nix
./sshd.nix
./teamspeak.nix
./nginx.nix
#./gitlab.nix
./nextcloud.nix
./news2kindle.nix
# ./news2kindle.nix
./resilio.nix
./sks.nix
# ./sks.nix
./gitea.nix
# ./nexus.nix
# ./wireguard.nix
#./mqtt.nix
# ./jitsi.nix
./docker.nix
./mailcow.nix
# ./unciv.nix
# ./hydra.nix
./postgres.nix
./xkcd-password.nix
./morss.nix
];
}

View File

@@ -1,29 +1,26 @@
{ config, pkgs, ... }:
#let
# pkgs = import <nixos-unstable> {};
#in
{
# environment.systemPackages = [ (import <nixos-unstable> {}).gitea ];
services.nginx.virtualHosts."gitea.stubbe.rocks" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://localhost:3000";
};
nixpkgs.config.packageOverrides = pkgs: {
gitea = (import <nixos-unstable> {}).gitea;
};
users.users.gitea.shell = pkgs.zsh;
imports = [
<nixos-unstable/nixos/modules/services/misc/gitea.nix>
];
services.postgresql.enable = true;
services.gitea = {
enable = true;
useWizard = true;
};
repositoryRoot = "/var/lib/gitea/gitea-repositories";
lfs.enable = true;
database.type = "postgres";
settings.service.DISABLE_REGISTRATION=true;
settings.server.ROOT_URL="https://gitea.stubbe.rocks";
# package = pkgs.gitea.override rec {
# buildGoModule = args: pkgs.buildGoModule ( args // {
# tags = args.tags ++ [ "bindata" ];
# });
# };
};
}

40
services/hydra.nix Normal file
View File

@@ -0,0 +1,40 @@
{ config, pkgs, ... }:
let
lAddress = "127.0.0.1";
lPort = 3001;
in
{
services.nginx.virtualHosts."hydra.stubbe.rocks" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://${lAddress}:${toString lPort}";
};
services.hydra = {
enable = true;
port = lPort;
hydraURL = "hydra.localhost";
notificationSender = "notitification@hydra.localhost";
extraConfig = ''
<dynamicruncommand>
enable = 1
</dynamicruncommand>
'';
};
services.postgresql = {
identMap =
''
hydra-users hydra hydra
hydra-users hydra-queue-runner hydra
hydra-users hydra-www hydra
hydra-users root postgres
hydra-users postgres postgres
'';
};
users.users.hydra-queue-runner.extraGroups = [ "docker" ];
}

12
services/jitsi.nix Normal file
View File

@@ -0,0 +1,12 @@
{ config, pkgs, ... }:
{
services.jitsi-meet = {
enable = true;
hostName = "jitsi.stubbe.rocks";
config = {
defaultLang = "de";
};
};
}

64
services/mailcow.nix Normal file
View File

@@ -0,0 +1,64 @@
{ config, pkgs, ... }:
let
unstable = import <nixos-unstable> { config = { allowUnfree = true; }; };
in
{
services.nginx.virtualHosts."mailcow.stubbe.rocks" = {
enableACME = true;
forceSSL = true;
default = true;
locations."/".proxyPass = "http://localhost:7080";
serverName = "v22017115146555724.happysrv.de";
serverAliases = [
"testmail.stubbe.rocks"
"mailcow.stubbe.rocks"
"stubbe.rocks"
# "autodiscover.testmail.stubbe.rocks"
# "autoconfig.testmail.stubbe.rocks"
# "autodiscover.mailcow.stubbe.rocks"
# "autoconfig.mailcow.stubbe.rocks"
];
};
security.acme.certs."v22017115146555724.happysrv.de".postRun = ''
cp fullchain.pem /opt/mailcow-dockerized/data/assets/ssl/cert.pem
cp key.pem /opt/mailcow-dockerized/data/assets/ssl/key.pem
cp chain.pem /opt/mailcow-dockerized/data/assets/ssl/chain.pem
'';
#services.nginx.virtualHosts."webmail.stubbe.rocks" = {
# enableACME = true;
# forceSSL = true;
# locations."/".proxyPass = "http://localhost:7080/SOGo/";
#};
systemd = {
timers.mailcow-update = {
wantedBy = [ "timers.target" ];
partOf = [ "mailcow-update.service" ];
timerConfig.OnCalendar = "weekly";
};
services.mailcow-update = {
path = [
pkgs.bash
pkgs.git
pkgs.curl
pkgs.gawk
pkgs.docker
unstable.docker-compose
pkgs.which
pkgs.coreutils-full
pkgs.unixtools.ping
pkgs.iptables
pkgs.openssl
];
serviceConfig.Type = "oneshot";
script = ''
cd /opt/mailcow-dockerized
./update.sh --no-update-compose --force --no-show-forced-updates
'';
};
};
}

11
services/morss.nix Normal file
View File

@@ -0,0 +1,11 @@
{ config, pkgs, ... }:
{
services.nginx.virtualHosts."morss.stubbe.rocks" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://localhost:8000";
};
}

33
services/mqtt.nix Normal file
View File

@@ -0,0 +1,33 @@
{ config, pkgs, ... }:
rec {
networking.firewall.allowedTCPPorts = [1883];
# security.acme.certs."mqtt.stubbe.rocks" = {
# email = "mqqt@stubbe.rocks";
# webroot = "/var/www/challenges/";
# allowKeysForGroup = true;
# group = "mosquitto";
# postRun = ''
# chmod g+rw -R /var/lib/acme/mqtt.stubbe.rocks
# chown mosquitto:root -R /var/lib/acme/mqtt.stubbe.rocks
# '';
# directory = "/var/lib/acme/mqtt.stubbe.rocks";
# };
services.mosquitto = rec {
enable = true;
# ssl = {
# enable = true;
# cafile = "/var/lib/acme/mqtt.stubbe.rocks/full.pem";
# certfile = "/var/lib/acme/mqtt.stubbe.rocks/cert.pem";
# keyfile = "/var/lib/acme/mqtt.stubbe.rocks/key.pem";
# };
host = "0.0.0.0";
checkPasswords = true;
users."eeN!ei2eilo1aiT6" = {
acl = [ "topic readwrite myink/#" ];
password = "AS5hoh5ug(ei8eer";
};
};
}

View File

@@ -1,111 +1,223 @@
{ config, pkgs, ... }:
let
myPhp = pkgs.php83.buildEnv {
extensions = { enabled, all }: with all; [ imagick opcache apcu redis memcached ] ++ enabled;
extraConfig = ''
opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=32
opcache.max_accelerated_files=15000
opcache.memory_consumption=256
opcache.save_comments=1
opcache.validate_timestamps=0
opcache.revalidate_freq=60
memory_limit=5G
post_max_size=5G
upload_max_filesize=5G
output_buffering=0
redis.session.locking_enabled=1
redis.session.lock_retries=-1
redis.session.lock_wait_time=10000
apc.enable_cli=1
'';
};
occ = pkgs.writeScriptBin "nextcloud-occ" ''
#! ${pkgs.runtimeShell}
cd /var/www/nextcloud
sudo=exec
if [[ "$USER" != nextcloud ]]; then
sudo='exec /run/wrappers/bin/sudo -u nextcloud --preserve-env=NEXTCLOUD_CONFIG_DIR --preserve-env=OC_PASS'
fi
export NEXTCLOUD_CONFIG_DIR="/var/www/nextcloud/config"
$sudo \
${myPhp}/bin/php \
occ "$@"
'';
daf = pkgs.writeScriptBin "nextcloud-daf" ''
#! ${pkgs.runtimeShell}
cd /var/www/nextcloud-tools/rescue
sudo=exec
if [[ "$USER" != nextcloud ]]; then
sudo='exec /run/wrappers/bin/sudo -u nextcloud --preserve-env=NEXTCLOUD_CONFIG_DIR --preserve-env=OC_PASS'
fi
export NEXTCLOUD_CONFIG_DIR="/var/www/nextcloud/config"
$sudo \
${myPhp}/bin/php \
decrypt-all-files.php "$@"
'';
phpfpmSocketName = "/run/phpfpm/nextcloud.sock";
in
{
environment.systemPackages = with pkgs; [ nextcloud ];
users.groups.nextcloud.members = [ "nextcloud" "nginx" ];
services.nginx.virtualHosts."cloud.stubbe.rocks" = {
enableACME = true;
forceSSL = true;
serverName = "cloud.stubbe.rocks";
root = "/var/www/nextcloud/";
extraConfig = ''
index index.php index.html /index.php$request_uri;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag "noindex, nofollow";
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
add_header X-Frame-Options sameorigin;
add_header Referrer-Policy no-referrer;
add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
client_max_body_size 1024M;
gzip off;
error_page 403 /core/templates/403.php;
error_page 404 /core/templates/404.php;
fastcgi_buffers 64 4K;
fastcgi_hide_header X-Powered-By;
gzip on;
gzip_vary on;
gzip_comp_level 4;
gzip_min_length 256;
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
'';
locations = {
"/robots.txt" = {
extraConfig = "allow all;";
"= /robots.txt" = {
priority = 100;
extraConfig = ''
allow all;
access_log off;
'';
};
"/.well-known/carddav" = {
extraConfig = "return 301 $scheme://$host/remote.php/dav;";
"= /" = {
priority = 100;
extraConfig = ''
if ( $http_user_agent ~ ^DavClnt ) {
return 302 /remote.php/webdav/$is_args$args;
}
'';
};
"/.well-known/caldav" = {
extraConfig = "return 301 $scheme://$host/remote.php/dav;";
};
# Root
"/" = {
priority = 900;
extraConfig = "rewrite ^ /index.php;";
};
"~ ^/store-apps" = {
priority = 201;
extraConfig = "root /var/lib/nextcloud;";
};
"~ ^/nix-apps" = {
priority = 201;
extraConfig = "root /var/lib/nextcloud;";
};
"^~ /.well-known" = {
priority = 210;
extraConfig = ''
rewrite ^ /index.php$uri;
absolute_redirect off;
location = /.well-known/carddav {
return 301 /remote.php/dav/;
}
location = /.well-known/caldav {
return 301 /remote.php/dav/;
}
location ~ ^/\.well-known/(?!acme-challenge|pki-validation) {
return 301 /index.php$request_uri;
}
try_files $uri $uri/ =404;
'';
};
# PHP files
"~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\\.php(?:$|/)" = {
"~ ^/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/)".extraConfig = ''
return 404;
'';
"~ ^/(?:\\.(?!well-known)|autotest|occ|issue|indie|db_|console)".extraConfig = ''
return 404;
'';
"~ ^\\/(?:index|remote|public|cron|core\\/ajax\\/update|status|ocs\\/v[12]|updater\\/.+|ocs-provider\\/.+|.+\\/richdocumentscode\\/proxy)\\.php(?:$|\\/)" = {
priority = 500;
extraConfig = ''
fastcgi_split_path_info ^(.+\\.php)(/.*)$;
include ${pkgs.nginx}/conf/fastcgi_params;
include ${config.services.nginx.package}/conf/fastcgi.conf;
fastcgi_split_path_info ^(.+?\.php)(\\/.*)$;
set $path_info $fastcgi_path_info;
try_files $fastcgi_script_name =404;
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass unix:/run/phpfpm/nextcloud.sock;
fastcgi_param HTTPS "on";
fastcgi_param modHeadersAvailable true;
fastcgi_param front_controller_active true;
fastcgi_pass unix:${phpfpmSocketName};
fastcgi_intercept_errors on;
fastcgi_request_buffering off;
fastcgi_read_timeout 120s;
'';
};
# CSS and JavaScript files
"~* ^/(?!apps-local).*\\.(?:css|js)$" = {
tryFiles = "$uri /index.php$uri$is_args$args";
};
# Other static assets
"~* ^/(?!apps-local).*\\.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$" = {
tryFiles = "$uri /index.php$uri$is_args$args";
};
# Locally installed apps:
#
# No need to specify location for PHP files of installed apps???
#
# CSS and JavaScript files for installed apps
"~* ^/apps-local/.*\\.(?:css|js)$" = {
root = "/var/nextcloud";
tryFiles = "$uri =404";
};
# Other static assets for installed apps
"~* ^/apps-local/.*\\.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$" = {
root = "/var/nextcloud";
tryFiles = "$uri =404";
};
"~ ^/(?:build|tests|config|lib|3rdparty|templates|data|\\.|autotest|occ|issue|indie|db_|console)" = {
extraConfig = "deny all;";
};
"~ \\.(?:css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite|map|ogg|flac)$".extraConfig = ''
try_files $uri /index.php$request_uri;
expires 6M;
access_log off;
location ~ \.mjs$ {
default_type text/javascript;
}
location ~ \.wasm$ {
default_type application/wasm;
}
'';
"~ ^\\/(?:updater|ocs-provider)(?:$|\\/)".extraConfig = ''
try_files $uri/ =404;
index index.php;
'';
"~ \\.(?:png|html|ttf|ico|jpg|jpeg|bcmap|mp4|webm)$".extraConfig = ''
try_files $uri /index.php$request_uri;
access_log off;
'';
"~ \.(otf|woff2?)$".extraConfig = ''
try_files $uri /index.php$request_uri;
expires 7d; # Cache-Control policy borrowed from `.htaccess`
access_log off; # Optional: Don't log access to assets
'';
};
};
users.extraUsers.nextcloud.packages = [
pkgs.php
pkgs.php71Packages.apcu
pkgs.php71Packages.memcached
pkgs.php71Packages.redis
pkgs.php71Packages.imagick
];
environment.systemPackages = [ occ daf ];
# Option I: PHP-FPM pool for Nextcloud
services.phpfpm.poolConfigs = let
phpfpmSocketName = "/run/phpfpm/nextcloud.sock";
services.phpfpm.pools.nextcloud = let
phpfpmUser = "nextcloud";
phpfpmGroup = "nextcloud";
server = "nginx";
in
{
nextcloud = ''
listen = ${phpfpmSocketName}
listen.owner = ${server}
listen.group = ${server}
user = ${phpfpmUser}
group = ${phpfpmGroup}
pm = ondemand
pm.max_children = 4
pm.process_idle_timeout = 10s
pm.max_requests = 200
'';
phpPackage = myPhp;
settings = {
"listen" = "${phpfpmSocketName}";
"listen.owner" = "${server}";
"listen.group" = "${server}";
"user" = "${phpfpmUser}";
"group" = "${phpfpmGroup}";
"pm" = "dynamic";
"pm.max_children" = "120";
"pm.start_servers" = "12";
"pm.min_spare_servers" = "6";
"pm.max_spare_servers" = "18";
};
phpEnv = {
NEXTCLOUD_CONFIG_DIR = "/var/www/nextcloud/config";
PATH = "/run/wrappers/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/usr/bin:/bin";
};
};
services.cron.enable = true;
services.redis.servers."".enable = true;
systemd.timers.nextcloud-cron = {
wantedBy = [ "timers.target" ];
timerConfig.OnBootSec = "5m";
timerConfig.OnUnitActiveSec = "15m";
timerConfig.Unit = "nextcloud-cron.service";
};
systemd.services.nextcloud-cron = {
environment.NEXTCLOUD_CONFIG_DIR = "/var/www/nextcloud/config";
serviceConfig.Type = "oneshot";
serviceConfig.User = "nextcloud";
serviceConfig.ExecStart = "${myPhp}/bin/php --define apc.enable_cli=1 -f /var/www/nextcloud/cron.php";
};
services.phpfpm.phpOptions = ''
opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1
'';
}

View File

@@ -0,0 +1,12 @@
--- a/bin/nexus 2025-05-02 22:27:48.000000000 +0200
+++ b/bin/nexus 2025-06-09 14:59:58.617397105 +0200
@@ -139,7 +139,8 @@
cd "$HOME" || exit 1
vmoptions_val=""
-read_vmoptions "nexus.vmoptions"
+VM_OPTS=${VM_OPTS_FILE:-"nexus.vmoptions"}
+read_vmoptions "$VM_OPTS"
INSTALL4J_ADD_VM_PARAMS="$INSTALL4J_ADD_VM_PARAMS $vmoptions_val"
# deduce the chosen data directory and prepare log and tmp directories

97
services/nexus.nix Normal file
View File

@@ -0,0 +1,97 @@
{ config, pkgs, lib, ...}:
let
lAddress = "127.0.0.1";
lPort = 9081;
nexusPkgs = pkgs.nexus.overrideAttrs (oldAttrs: rec {
pname = "nexus";
version = "3.80.0-06";
sourceRoot = "${pname}-${version}";
src = pkgs.fetchurl {
url = "https://download.sonatype.com/nexus/3/nexus-${version}-linux-x86_64.tar.gz";
sha256 = "sha256-+Xr6qmmG1tH2wWv+jyZzkZJMB1hngO51IXLyfwKUfS0=";
};
patches = [
# ./nexus-bin.patch
./nexus-vm-opts.patch
];
postPatch = ''
substituteInPlace bin/nexus.vmoptions \
--replace-fail ../sonatype-work /var/lib/sonatype-work \
--replace-fail =. =$out
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -rfv * $out
rm -fv $out/bin/nexus.bat
wrapProgram $out/bin/nexus \
--set JAVA_HOME ${pkgs.jdk17_headless} \
--set ALTERNATIVE_NAME "nexus" \
--prefix PATH "${lib.makeBinPath [ pkgs.gawk ]}"
runHook postInstall
'';
});
home ="/var/lib/sonatype-work";
package = nexusPkgs;
in
{
services.nginx.virtualHosts."nexus.stubbe.rocks" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://${lAddress}:${toString lPort}";
};
services.nexus= {
enable = true;
listenAddress = lAddress;
listenPort = lPort;
package = nexusPkgs;
jvmOpts = ''
-Xms2703m
-Xmx2703m
-XX:+UnlockDiagnosticVMOptions
-XX:+LogVMOutput
-XX:LogFile=${home}/nexus3/log/jvm.log
-XX:-OmitStackTraceInFastThrow
-Djava.net.preferIPv4Stack=true
-Dkaraf.home=${package}
-Dkaraf.base=${package}
-Dkaraf.etc=${package}/etc/karaf
-Djava.util.logging.config.file=${package}/etc/karaf/java.util.logging.properties
-Dkaraf.data=${home}/nexus3
-Djava.io.tmpdir=${home}/nexus3/tmp
-Djdk.tls.ephemeralDHKeySize=2048
--add-reads=java.xml=java.logging
--add-opens
java.base/java.security=ALL-UNNAMED
--add-opens
java.base/java.net=ALL-UNNAMED
--add-opens
java.base/java.lang=ALL-UNNAMED
--add-opens
java.base/java.util=ALL-UNNAMED
--add-opens
java.naming/javax.naming.spi=ALL-UNNAMED
--add-opens
java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED
--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED
--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED
--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED
--add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED
--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED
--add-exports=java.security.sasl/com.sun.security.sasl=ALL-UNNAMED
--add-exports=java.base/sun.security.x509=ALL-UNNAMED
--add-exports=java.base/sun.security.rsa=ALL-UNNAMED
--add-exports=java.base/sun.security.pkcs=ALL-UNNAMED
'';
};
programs.nix-ld.enable = true;
}

View File

@@ -6,6 +6,7 @@
networking.firewall.allowedTCPPorts = [80 443 ];
services.nginx = {
appendHttpConfig= ''server_names_hash_bucket_size 64;'';
enable = true;
sslProtocols = "TLSv1 TLSv1.1 TLSv1.2";
# sslCiphers = "DHE+RSA+AES128+SHA:EECDH+aRSA+AESGCM:EDH+aRSA:EECDH+aRSA:+AES256:+AES128:+SHA1:!CAMELLIA:!SEED:!3DES:!DES:!RC4:!eNULL";
@@ -15,3 +16,4 @@ services.nginx = {
recommendedTlsSettings = false;
};
}

9
services/postgres.nix Normal file
View File

@@ -0,0 +1,9 @@
{ config, pkgs, ... }:
{
# used for gitea and nextcloud
services.postgresql = {
enable = true;
package = pkgs.postgresql_18;
};
}

View File

@@ -7,7 +7,7 @@
};
services.sks.enable = true;
services.sks.extraDbConfig = "set_flags DB_LOG_AUTOREMOVE";
networking.firewall.allowedTCPPorts = [ config.services.sks.hkpPort];
services.pgpkeyserver-lite.enable = true;
services.pgpkeyserver-lite.hostname = "keys.stubbe.rocks";

View File

@@ -2,7 +2,7 @@
{
services.openssh.enable = true;
services.openssh.passwordAuthentication = false;
services.openssh.challengeResponseAuthentication = false;
services.openssh.permitRootLogin = "no";
services.openssh.settings.PasswordAuthentication = false;
services.openssh.settings.KbdInteractiveAuthentication = false;
services.openssh.settings.PermitRootLogin = "no";
}

View File

@@ -1,5 +1,7 @@
{ config, pkgs, ... }:
let
unstable = import <nixos-unstable> { config = { allowUnfree = true; }; };
in
{
networking.firewall.allowedTCPPorts = [
30033 # ts TCP port opened for file transfers.
@@ -10,6 +12,10 @@
9987 # ts port
];
nixpkgs.config.packageOverrides = pkgs: {
teamspeak_server = unstable.teamspeak_server;
};
services.teamspeak3= {
enable = true;
};

15
services/unciv.nix Normal file
View File

@@ -0,0 +1,15 @@
{ config, pkgs, ... }:
let
uc = pkgs.callPackage ../module/unciv/unciv.nix {
port = "9880";
nginxIsDefault = false;
};
in
{
systemd.services.unciv = uc.systemd.services.unciv;
services.nginx.virtualHosts."unciv.stubbe.rocks" = uc.nginx.virtualHosts.unciv;
}

35
services/vaheim.nix Normal file
View File

@@ -0,0 +1,35 @@
{ config, pkgs, ... }:
let
runEnv = (pkgs.buildFHSUserEnv {
name = "vaheim-env";
targetPkgs = pkgs: (with pkgs;
[
file
]);
runScript = ''
bash ./start_server.sh
'';
});
in
{
networking.firewall.allowedTCPPorts = [2456 2457 2458];
networking.firewall.allowedUDPPorts = [2456 2457 2458];
systemd.services.vaheim = {
description = "vaheim";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
User = "sshuser";
Group = "users";
WorkingDirectory = "/home/sshuser/valheim_neu";
ExecStart = "${runEnv}/bin/vaheim-env";
Restart = "always";
};
};
}

1
services/wg0.key Normal file
View File

@@ -0,0 +1 @@
qGHCeu53Sf6I8FUemPb36/nWbteef6H1Iz6BvE8/ek8=

20
services/wireguard.nix Normal file
View File

@@ -0,0 +1,20 @@
{ config, pkgs, ... }:
{
environment.systemPackages = [ pkgs.wireguard ];
networking.firewall.allowedTCPPorts = [ 51820 ];
networking.firewall.allowedUDPPorts = [ 51820 ];
networking.wireguard.interfaces.wg0 = {
listenPort = 51820;
privateKeyFile = "/etc/nixos/services/wg0.key";
ips = [ "192.168.43.1/32" ];
peers = [
{
allowedIPs = ["192.168.43.2/32"];
publicKey = "wbeCSyurE/kiXooaqieRgoDHJiDBiw/CHvF5e+LCPlw=";
persistentKeepalive = 25;
}
];
};
}

View File

@@ -0,0 +1,11 @@
{ config, pkgs, ... }:
{
services.nginx.virtualHosts."xkcd-pw.stubbe.rocks" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://localhost:8080";
};
}

View File

@@ -5,19 +5,21 @@ let
openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKShnz3ceVcg3axVXv/GGcjyFAfcjuDR1i5o6JzVvnmlWpWvClnYSBNb/oEDDq5pSPSBvCYp2HwZpmkYEV/C3lBbUsmLtOlUrzkm0ibgHraTVyHUq3OSYckXEvUYRCCtGqvRRehERrhPZV6oXBE8aBUk26xTpOJpLFPy7spF4sBwKPSE2igTIYtJSfJYi3wn2KoW1q1RLMasC4fdvgNCVIxxBq72uMcRUcPc4jL8n11UFfepJrwSQ7Z7KxsZXdz5JFVl6QEE6cVSSEAuuEefNYANrp5S3h/lUowrUOcu0ml2c7CJWPpaOb4GvFlio4woc0lCATrA2341V0xshl40Xd dev@stubbfel"
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDjKB6Pr/hvKhwwwXoTtAy3r68JwUo7WyueSJbUkuk4hkLCtkD/LZ9ZavOzY6PEaQsTW7qcRNxUB4FjHX26pRCfB1U9TVBsE6gEgCYcuSBjKGgIOeeCSufJ2N3xUsaO+MBpnBPfgAJeUwFdSZLH1lv981adZ3IlkjQkj6oGfMK5aJv0P+bJjhmI5Ym5K0hMD6UOI2qRFEOjkO/49G7zf/0SegZAU9ySexRCvPw5g2ilRUqrIsv1Z9HMu+dYKlZq9QvWgbgv5K2oKuL4oBydQ/PomBauQkwyFRkRvPo1gCJOBvwduZvVE7QQoBXYsNSv+fsPu1s2OOSzAKCyvIMjQ34z user@stubbfel"
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDjlSTPEBtQhs7pRe17pvApLvtJfwbvxygZURnjGho/svAraMAYOYmDlaoxhYgk6VYS4mmuRpVQZpsq12PqeoFfOPh4cGLQTE5zEzqQWwg7vdRut/eFQCh2KQbWy0eWIK8kEZ4c2xu+YH6YQZ0sRTYPhLooTeOGGflKko7RjCyBZnNbjehIwW+aRCqe//HhFCYOay3ow3TKpDqfo0DF9Ps3sS9un2Tx4uVQUsbybUv6OdpprhPsfHf8THnKcHqIYjkUxJpcX3ZJsA9tNCs8cs7KlsFa4a0AhZ4NaSn4+HI2OQwuPFU/c0o4VwNdF7T71MOMqOoAmE5/ZZer+PGNIRaj user@stubbfel_pc"
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDDAUuWrss+AJp+DpFuyMhNEmrdOQX2t9EGonSs6nFmzY3cjb453k/2BL8r6djIUihywT2SxTxyDrYYVoJNNPCoU6I29uNDuvHmK3zAe1lPmKlw10KN7D38y43rkhFgX28lIMcl1evt/UqN/vVo/ihlMlCxeK1lEnh9UOPKDWn38b6tr4YPYDiDgs1AgE9MG0W8OKNTtLAT4Z0oUbDPsRyntXFelvMZi8Q4+VLUML1pY8Chf35sSs8nHJTTuRwgtLMzvGUkMGTAPJtMjx63bGFpe2xrhnf7+cyfPqNOHAuLyVbObHSzLNL8Rq/BtCYPp923FQHWwYdkkP62XBb6wXsXn0r+dnqMIv9Jqu/r1/4Oz7vFG5T0yvBju5ZB20HtsmiGMk68W0ZabFgZIoSPvE8hAM8aF0yxu6LrY4P8AHb0iCQq7V04FLfpMCdRHzAbbCWEMR3IH5aaixfwl7HnA9mgkBIF78pZiFch/NMjhs/4/T56t+t/vTmArJRAGgmv408= stubbfel@stubbfel-pinebook"
];
};
in
{
virtualisation.docker.enable = true;
# virtualisation.docker.enable = true;
users = {
defaultUserShell = pkgs.zsh;
extraUsers.etherpad = myPublicSshKeys // { isNormalUser = true; home = "/home/etherpad";};
# extraUsers.etherpad = myPublicSshKeys // { isNormalUser = true; home = "/home/etherpad";};
extraUsers.sshuser = myPublicSshKeys // { isNormalUser = true; home = "/home/sshuser";};
extraUsers.nextcloud = myPublicSshKeys // { isNormalUser = true; home = "/home/nextcloud"; group = "nextcloud";};
extraUsers.ledebuild = myPublicSshKeys // { isNormalUser = true; home = "/home/ledebuild"; extraGroups = [ "docker" ];};
extraUsers.nextcloud = myPublicSshKeys // { isSystemUser = true; home = "/home/nextcloud"; createHome= true; group = "nextcloud";};
# extraUsers.ledebuild = myPublicSshKeys // { isNormalUser = true; home = "/home/ledebuild"; extraGroups = [ "docker" ];};
# extraUsers.gitea = myPublicSshKeys // { isNormalUser = true; home = "/home/gitea"; };
extraGroups.nexdcloud.name = "nextcloud";
};