system/roles/server.nix (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | {
config,
pkgs,
lib,
...
}:
{
imports = [
../settings/configuration/nix-linux.nix
../settings/configuration/auto-upgrade.nix
../settings/configuration/date-time.nix
../settings/configuration/locale.nix
../settings/services/tailscale.nix
../settings/services/syncthing.nix
../settings/services/caddy.nix
../settings/services/ssh.nix
./base.nix
];
services.tailscale = {
useRoutingFeatures = "both";
extraSetFlags = [
"--advertise-exit-node"
];
};
services.sshguard = {
enable = true;
};
services.journald.extraConfig = ''
MaxRetentionSec=1 month
'';
systemd.services.update-home-manager = {
startAt = "weekly";
path = with pkgs; [
openssh
nix
config.programs.git.package
];
serviceConfig = rec {
Type = "oneshot";
User = "alin";
ExecStart = "${lib.getExe pkgs.home-manager} switch --flake ${config.system.autoUpgrade.flake}#${User}@%H";
};
};
services.syncthing = {
dataDir = "/srv/syncthing";
configDir = "/var/lib/syncthing";
guiAddress = "[::]:8384";
};
}
|