Files
homelab/common.nix
T
erik ac05d948b6 refactor: rename vps host -> neptun (solar-system theme)
git-mv hosts/vps->neptun, secrets/vps.yaml->neptun.yaml; update flake, .sops.yaml
rules, hostName, sops paths, README/CLAUDE. Off-repo host key dir renamed too.
2026-07-14 13:32:44 +02:00

49 lines
1.4 KiB
Nix

{ pkgs, ... }:
# Shared base for all hosts: user, SSH hardening, nix settings, packages.
# (jupiter still carries its own copy in services.nix; neptun uses this.)
{
# ---- 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 ];
}