aboutsummaryrefslogtreecommitdiff
path: root/modules/common.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/common.nix')
-rw-r--r--modules/common.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/modules/common.nix b/modules/common.nix
new file mode 100644
index 0000000..e5c38d4
--- /dev/null
+++ b/modules/common.nix
@@ -0,0 +1,56 @@
+{ pkgs, ... }:
+
+{
+ # European timezone
+ time.timeZone = "Europe/Amsterdam";
+ i18n.defaultLocale = "en_US.UTF-8";
+
+ # SSH: key-only, no passwords, no root login
+ services.openssh = {
+ enable = true;
+ settings = {
+ PasswordAuthentication = false;
+ PermitRootLogin = "no";
+ KbdInteractiveAuthentication = false;
+ };
+ };
+
+ # Firewall: only allow SSH, HTTP, HTTPS, and DNS (for AdGuard)
+ networking.firewall = {
+ enable = true;
+ allowedTCPPorts = [ 22 80 443 53 ];
+ allowedUDPPorts = [ 53 ];
+ };
+
+ # Nix settings: flakes, auto-gc, auto-optimise
+ nix = {
+ settings = {
+ experimental-features = [ "nix-command" "flakes" ];
+ auto-optimise-store = true;
+ trusted-users = [ "root" "admin" ];
+ };
+ gc = {
+ automatic = true;
+ dates = "weekly";
+ options = "--delete-older-than 14d";
+ };
+ };
+
+ # Base system packages
+ environment.systemPackages = with pkgs; [
+ git
+ htop
+ curl
+ vim
+ age
+ ssh-to-age
+ sops
+ ];
+
+ # Automatic security updates for the OS
+ system.autoUpgrade = {
+ enable = false; # set to true once you are comfortable with unattended reboots
+ flake = "github:YOUR_USERNAME/nix#eurovm"; # update to your actual flake URL
+ flags = [ "--update-input" "nixpkgs" ];
+ };
+}