My NixOS config.
at main 51 lines 1.4 kB view raw
1{ config, lib, pkgs, ... }: 2{ 3 options.custom.headless = lib.mkOption 4 { type = lib.types.bool; 5 default = true; 6 description = "enable headless features."; 7 }; 8 9 config = lib.mkIf config.custom.headless 10 { boot.kernelParams = [ "consoleblank=10" ]; 11 programs.mosh.enable = true; 12 environment.systemPackages = with pkgs; [ zellij ]; 13 14 services = 15 { 16 auto-cpufreq.settings.charger.governor = lib.mkDefault "powersave"; 17 18 openssh = 19 { enable = true; 20 settings = 21 { PasswordAuthentication = false; 22 KbdInteractiveAuthentication = false; 23 PermitRootLogin = "yes"; 24 }; 25 }; 26 27 logind.settings.Login = 28 { HandleLidSwitch = "suspend"; 29 HandleLidSwitchExternalPower = "lock"; 30 }; 31 32 tailscale = 33 { enable = true; 34 useRoutingFeatures = "both"; 35 authKeyFile = config.age.secrets.tailscale-authkey.path; 36 extraUpFlags = 37 [ "--advertise-exit-node" 38 ]; 39 }; 40 41 }; 42 43 age = 44 { identityPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; 45 secrets.tailscale-authkey = 46 { file = ../secrets/encrypted/tailscale-authkey.age; 47 mode = "400"; 48 }; 49 }; 50 }; 51}