Files
nix/hosts/hecuba/default.nix

81 lines
1.3 KiB
Nix

{
inputs,
pkgs,
config,
...
}:
# Also see <https://wiki.nixos.org/wiki/Install_NixOS_on_Hetzner_Cloud>
{
imports = [
inputs.disko.nixosModules.disko
../../modules/common
./hard.nix
../../modules/ssh
../../modules/docker
];
host = {
username = "username";
name = "hecuba";
};
networking.hostName = config.host.name;
ssh = {
inherit (config.host) username;
publicHostname = "server.hektormisplon.xyz";
authorizedHosts = [
"andromache"
"astyanax"
];
};
docker.user = config.host.username;
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "ext4";
};
swapDevices = [
{
device = "/dev/disk/by-label/swap";
}
];
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda";
users.users = {
root.hashedPassword = "!";
${config.host.username} = {
isNormalUser = true;
extraGroups = [ "wheel" ];
};
};
security.sudo.wheelNeedsPassword = false;
networking.firewall = {
enable = true;
allowedTCPPorts = [
80
443
];
};
environment.systemPackages = with pkgs; [
vim
git
];
services.fail2ban = {
enable = true;
maxretry = 5;
};
}