From 1b16b40a791f4c41a5555a41ce43c14dd296868e Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Fri, 4 Oct 2019 22:30:36 +0200 Subject: [PATCH 1/5] ftp: ajout nico --- containers/vsftpd.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/containers/vsftpd.nix b/containers/vsftpd.nix index a21d8ee..409ab6f 100644 --- a/containers/vsftpd.nix +++ b/containers/vsftpd.nix @@ -11,7 +11,7 @@ forceLocalDataSSL = true; userlistDeny = false; localUsers = true; - userlist = ["claire" "manu" "lakeu" "fusil" "stryxion"]; + userlist = ["claire" "manu" "lakeu" "fusil" "stryxion" "nico"]; rsaCertFile = "/var/vsftpd/vsftpd.pem"; extraConfig = '' pasv_min_port=64000 @@ -50,6 +50,12 @@ hashedPassword = "$6$KZKwBLI6yGuvFg2Q$VCfSnhAacgxlxybTyuCDyNQ2InM8ppG3aa3Bw176TiNAX8tHWUpKesfI9YfcCoGAi1zSzA7b6uC8BmmfrQwg1."; description = "Stryxion"; }; + + nico = { + isNormalUser = true; + hashedPassword = "$6$.sMznhhJ0fG2qx$XevsEqsjlLAnu/VMgeA6B5YfWY36dUZXtUGiEgPueHzRcfAEi2UXLWRHqcN6AsW1AozepeAP6/lZW3fDAyULA1"; + description = "MAGENI"; + }; }; }; bindMounts = { From 4ee31add541701a09b77563b5ab6e61a15ee93de Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Fri, 4 Oct 2019 22:31:43 +0200 Subject: [PATCH 2/5] ajout serveur Minecraft --- systems/LoutreOS/configuration.nix | 2 +- systems/LoutreOS/services.nix | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/systems/LoutreOS/configuration.nix b/systems/LoutreOS/configuration.nix index 44839c5..152ee1c 100644 --- a/systems/LoutreOS/configuration.nix +++ b/systems/LoutreOS/configuration.nix @@ -33,7 +33,7 @@ in ]; nixpkgs.config.allowUnfree = false; - nixpkgs.config.allowUnfreePredicate = (pkg: builtins.elem (builtins.parseDrvName pkg.name).name [ "factorio-headless" "perl5.28.1-slimserver" ]); + nixpkgs.config.allowUnfreePredicate = (pkg: builtins.elem (builtins.parseDrvName pkg.name).name [ "factorio-headless" "perl5.28.1-slimserver" "minecraft-server" ]); services.zfs = { autoSnapshot.enable = true; diff --git a/systems/LoutreOS/services.nix b/systems/LoutreOS/services.nix index 6d5ae8d..7966657 100644 --- a/systems/LoutreOS/services.nix +++ b/systems/LoutreOS/services.nix @@ -419,6 +419,30 @@ in enable = true; maxMemory = 500; }; + + minecraft-server = { + enable = true; + jvmOpts = "-Xms512m -Xmx3072m"; + eula = true; + declarative = true; + openFirewall = true; + whitelist = { + nyanloutre = "db0669ea-e332-4ca3-8d50-f5d1458f5822"; + Hautension = "f05677f4-be5a-47df-ad77-21c739180aa2"; + LordDarkKiwi = "79290cfc-0b00-484f-9c94-ab0786402de6"; + Madahin = "f5f747e3-fac2-43e8-9b9b-a67dc2f368ff"; + Hopegcx = "4497f759-2210-48db-8764-307d33011442"; + wyrd68 = "127a3021-cdc1-419f-9010-4651df9ae3af"; + sparsyateloutre = "d2ff63c1-4e9f-4b21-9bfc-decce5d987b3"; + }; + serverProperties = { + difficulty = 2; + gamemode = 0; + max-players = 50; + motd = "Hi Mark !"; + white-list = true; + }; + }; }; systemd.services.dogetipbot-telegram = { From f621cb3a21718c9eea26b59a401d0f18ed145a82 Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Fri, 4 Oct 2019 22:32:59 +0200 Subject: [PATCH 3/5] ajout bot mautrix-telegram --- systems/LoutreOS/services.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/systems/LoutreOS/services.nix b/systems/LoutreOS/services.nix index 7966657..bf09956 100644 --- a/systems/LoutreOS/services.nix +++ b/systems/LoutreOS/services.nix @@ -307,6 +307,30 @@ in disable_existing_loggers: False ''; + app_service_config_files = [ + "/var/lib/matrix-synapse/mautrix-telegram-registration.yaml" + ]; + }; + + mautrix-telegram = { + enable = true; + settings = { + homeserver = { + address = "https://matrix.nyanlout.re"; + domain = "nyanlout.re"; + }; + appservice = { + bot_username = "loutrebot"; + }; + bridge = { + relaybot.authless_portals = false; + permissions = { + "@nyanloutre:nyanlout.re" = "admin"; + }; + }; + }; + environmentFile = "/mnt/secrets/mautrix-telegram.env"; + serviceDependencies = [ "matrix-synapse.service" ]; }; pgmanage = { From a06a8bebab237eb65acd5ffd40bdc5fae5ea0076 Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Fri, 4 Oct 2019 22:34:13 +0200 Subject: [PATCH 4/5] wireguard: config serveur pour NAT --- systems/LoutreOS/services.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/systems/LoutreOS/services.nix b/systems/LoutreOS/services.nix index bf09956..8951e9d 100644 --- a/systems/LoutreOS/services.nix +++ b/systems/LoutreOS/services.nix @@ -502,16 +502,19 @@ in ips = [ "192.168.20.1/24" ]; privateKeyFile = "/mnt/secrets/wireguard/wg0.privatekey"; listenPort = 51820; - allowedIPsAsRoutes = false; + allowedIPsAsRoutes = true; peers = [ { - allowedIPs = [ "0.0.0.0/0" ]; + allowedIPs = [ "192.168.20.2/32" ]; publicKey = "b/SXiqo+GPdNOc54lyEVeUBc6B5AbVMKh+g5EZPGzlE="; } ]; }; }; + nat.internalInterfaces = [ "wg0" ]; + nat.internalIPs = [ "192.168.20.0/24" ]; + firewall.allowedTCPPorts = [ 51413 # Transmission 8448 # Matrix federation From 9d252f374cb42792bc8726528e7dc4c2220e61f0 Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Fri, 4 Oct 2019 22:38:36 +0200 Subject: [PATCH 5/5] =?UTF-8?q?mise=20=C3=A0=20jour=20LoutreOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- systems/LoutreOS/configuration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systems/LoutreOS/configuration.nix b/systems/LoutreOS/configuration.nix index 152ee1c..bc6be76 100644 --- a/systems/LoutreOS/configuration.nix +++ b/systems/LoutreOS/configuration.nix @@ -5,7 +5,7 @@ { config, pkgs, ... }: let - gitRev = "91cb80e4397d55b19b0beba3fa3846f1a02d0342"; + gitRev = "4c45e960e797d660358a11723e736afee3998261"; nixpkgs = fetchTarball "https://github.com/nyanloutre/nixpkgs/archive/${gitRev}.tar.gz"; in {