2024-02-29 14:53:34 +00:00
|
|
|
{ pkgs, home-manager, lib, config, ... }:
|
|
|
|
let
|
2024-03-11 04:07:31 +00:00
|
|
|
start-haven = pkgs.writeShellScriptBin "start-haven" (builtins.readFile ./start-haven.sh);
|
2024-02-29 14:53:34 +00:00
|
|
|
in
|
|
|
|
{
|
2024-05-03 21:32:27 +00:00
|
|
|
imports = [ ./hardware-configuration.nix ];
|
2024-02-29 14:53:34 +00:00
|
|
|
|
|
|
|
system.stateVersion = "24.05";
|
2024-04-24 17:44:57 +00:00
|
|
|
system.autoUpgrade.enable = lib.mkForce false;
|
2024-02-29 14:53:34 +00:00
|
|
|
|
|
|
|
host = {
|
|
|
|
role = "server";
|
2024-03-11 16:38:32 +00:00
|
|
|
apps.development.kubernetes.enable = true;
|
2024-02-29 14:53:34 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Enable SSH
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
ports = [ 33105 ];
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
# require public key authentication for better security
|
|
|
|
PasswordAuthentication = false;
|
|
|
|
KbdInteractiveAuthentication = false;
|
|
|
|
PubkeyAuthentication = true;
|
|
|
|
|
|
|
|
PermitRootLogin = "without-password";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-05-06 13:37:46 +00:00
|
|
|
# Enable mdadm and Sapana (RAID 5 primary storage)
|
|
|
|
boot.swraid = {
|
|
|
|
enable = true;
|
|
|
|
# mdadmConf configured in nix-secrets
|
|
|
|
};
|
|
|
|
|
2024-04-01 16:30:07 +00:00
|
|
|
# Open port for OpenVPN
|
2024-05-06 13:37:46 +00:00
|
|
|
networking.firewall.allowedUDPPorts = [ 1194 ];
|
2024-04-01 16:30:07 +00:00
|
|
|
|
2024-02-29 14:53:34 +00:00
|
|
|
# Add script for booting Haven
|
2024-03-11 04:07:31 +00:00
|
|
|
environment.systemPackages = [
|
|
|
|
start-haven
|
2024-02-29 14:53:34 +00:00
|
|
|
];
|
2024-04-01 16:30:07 +00:00
|
|
|
}
|