nix/packages/hosts/generic-headless.nix
Daniel Flanagan 873677088d
Some checks failed
/ check (push) Failing after 40s
feat: wip generic hosts
2025-02-19 12:09:14 -06:00

60 lines
1.3 KiB
Nix

{
hardware,
config,
...
}:
{
system.stateVersion = "24.05";
networking.hostName = "lyte-generic-headless";
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"ehci_pci"
"usbhid"
"uas"
"sd_mod"
];
imports = with hardware; [
common-cpu-amd
common-pc-ssd
];
users.groups.beefcake = { };
users.users = {
beefcake = {
isSystemUser = true;
createHome = true;
home = "/storage/backups/beefcake";
group = "beefcake";
extraGroups = [ "sftponly" ];
openssh.authorizedKeys.keys = config.users.users.daniel.openssh.authorizedKeys.keys ++ [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK7HrojwoyHED+A/FzRjYmIL0hzofwBd9IYHH6yV0oPO root@beefcake"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAOEI82VdbyR1RYqSnFtlffHBtHFdXO0v9RmQH7GkfXo restic@beefcake"
];
};
};
services.openssh.extraConfig = ''
Match Group sftponly
ChrootDirectory /storage/backups/%u
ForceCommand internal-sftp
AllowTcpForwarding no
'';
networking = {
wifi.enable = true;
firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [ 22 ];
};
};
services.tailscale.useRoutingFeatures = "server";
home-manager.users.daniel = {
lyte.shell.enable = true;
};
}