1
0
Fork 0
nix-configuration/hosts/Haven/default.nix

71 lines
1.5 KiB
Nix
Raw Normal View History

{
pkgs,
home-manager,
lib,
config,
...
}:
2024-02-29 14:53:34 +00:00
let
start-haven = pkgs.writeShellScriptBin "start-haven" (builtins.readFile ./start-haven.sh);
2024-02-29 14:53:34 +00:00
in
{
imports = [ ./hardware-configuration.nix ];
system.stateVersion = "24.05";
system.autoUpgrade.enable = lib.mkForce false;
2024-02-29 14:53:34 +00:00
host = {
role = "server";
apps.development.kubernetes.enable = true;
services = {
apcupsd.enable = true;
duplicacy-web = {
enable = true;
autostart = false;
environment = "${config.users.users.aires.home}";
};
k3s = {
enable = true;
role = "server";
};
msmtp.enable = true;
};
users = {
aires = {
enable = true;
services = {
syncthing = {
enable = true;
autostart = false;
};
};
};
media.enable = true;
};
};
2024-02-29 14:53:34 +00:00
# Enable SSH
services.openssh = {
enable = true;
ports = [ 33105 ];
2024-02-29 14:53:34 +00:00
settings = {
# require public key authentication for better security
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
PubkeyAuthentication = true;
2024-02-29 14:53:34 +00:00
PermitRootLogin = "without-password";
};
};
2024-02-29 14:53:34 +00:00
2024-05-16 16:19:04 +00:00
# Allow Haven to be a build target for other architectures (mainly ARM64)
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
2024-05-06 13:37:46 +00:00
# Open port for OpenVPN
networking.firewall.allowedUDPPorts = [ 1194 ];
# Add script for booting Haven
environment.systemPackages = [ start-haven ];
}