Files
Gebos/nix/hosts/common.nix
T
2026-06-26 16:12:57 +02:00

37 lines
1.1 KiB
Nix

{ config, lib, pkgs, ... }:
{
system.stateVersion = "26.05";
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
trusted-users = [ "@wheel" "deploy" ];
};
# deploy-rs SSHes in as `deploy` and uses sudo to activate.
users.users.deploy = {
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJuB+MbW/YuXYGZ/lm6dp+aHJ1YqfaEkiqgj/Z6+cdd0 me@larsnolden.com" # developer machines key
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB9LFaFbro5jU9jG0ZNn66FO61gniKfi865jS6TnZ+SU deploy" # deployment nodes key
];
};
security.sudo.wheelNeedsPassword = false;
services.openssh = {
enable = true;
settings.PasswordAuthentication = false;
};
# TODO: restrict inbound SSH (port 22) to the Gitea deployment runner's IP
# only, instead of leaving it open to the world. Likely via
# services.openssh.openFirewall = false + a firewall.extraInputRules rule
# accepting tcp dport 22 from the runner's source address.
networking.firewall.enable = true;
time.timeZone = "UTC";
environment.systemPackages = with pkgs; [ vim curl jq ];
}