Files
homelab/common.nix
T
darmanandClaude Sonnet 5 4679afa505 Trim comments across configs and services
Shorten verbose multi-paragraph comments to essentials, and drop a
stale claim in common.nix that jupiter kept its own copy of the base
config (it now imports common.nix directly).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-20 06:04:27 +02:00

48 lines
1.3 KiB
Nix

{ pkgs, ... }:
# Shared base for all hosts: user, SSH hardening, nix settings, packages.
{
# ---- User ----
users.users.darman = {
isNormalUser = true;
description = "darman";
extraGroups = [ "wheel" "networkmanager" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGZpkPVhzi1zG5JI9hWyUgdyvNIQbp4ts4jw3idpMhhN erik@laptop"
];
};
security.sudo.wheelNeedsPassword = false;
# ---- SSH (key-only) ----
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
# ---- Nix ----
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
# trust wheel so `nixos-rebuild --target-host darman@…` can push closures.
trusted-users = [ "root" "@wheel" ];
};
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
environment.systemPackages = with pkgs; [ vim git htop tmux curl ];
# ---- Locale / firewall base ----
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
# Firewall on, ssh always allowed. Service modules add their own ports
# (samba via openFirewall, caddy 80/443, tailscale trusts tailscale0).
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [ 22 ];
}