From 82388fbf2b33b048a47c8eed38e662046db7d7da Mon Sep 17 00:00:00 2001 From: "Simon R. - fantomitechno" Date: Mon, 22 Jun 2026 20:00:31 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20server=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.nix | 1 + hosts/conseil/default.nix | 22 ++++++++++++++++++++++ hosts/server.nix | 19 +++++++++++++++++++ modules/ssh.nix | 14 ++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 hosts/conseil/default.nix create mode 100644 hosts/server.nix create mode 100644 modules/ssh.nix diff --git a/flake.nix b/flake.nix index b380577..da5a9e4 100644 --- a/flake.nix +++ b/flake.nix @@ -81,6 +81,7 @@ fantomitechno-laptop = commonSystem "laptop"; fantomitechno-desktop = commonSystem "desktop"; fantomitechno-msi = commonSystem "msi"; + conseil = commonSystem "conseil"; }; }; } diff --git a/hosts/conseil/default.nix b/hosts/conseil/default.nix new file mode 100644 index 0000000..f961ce3 --- /dev/null +++ b/hosts/conseil/default.nix @@ -0,0 +1,22 @@ +{ + pkgs, + ... +}: + +{ + imports = [ + ./hardware-configuration.nix + ../server.nix + ]; + + # Bootloader + boot = { + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + kernelPackages = pkgs.linuxPackages; + }; + + system.stateVersion = "26.05"; +} diff --git a/hosts/server.nix b/hosts/server.nix new file mode 100644 index 0000000..0cfa4d1 --- /dev/null +++ b/hosts/server.nix @@ -0,0 +1,19 @@ +{ hostname, ... }: { + imports = builtins.map (i: ../modules/${i}) ([ + "cli-apps" + "fastfetch" + "git" + "docker.nix" + "ssh.nix" + ]); + + networking.hostName = "${hostname}"; + + services.xserver.xkb = { + layout = "fr"; + variant = ""; + }; + + # Configure console keymap + console.keyMap = "fr"; +} diff --git a/modules/ssh.nix b/modules/ssh.nix new file mode 100644 index 0000000..f50bd63 --- /dev/null +++ b/modules/ssh.nix @@ -0,0 +1,14 @@ +{ ... }: { + services.openssh = { + enable = true; + openFirewall = true; + settings = { + PasswordAuthentication = false; + KbdInteractiveAuthentication = false; + PermitRootLogin = "no"; + AllowUsers = [ "fantomitechno" ]; + MaxAuthTries = 3; + PerSourcePenalties = "crash:3600s authfail:3600s max:86400s"; + }; + }; +} -- 2.51.2