nixos/hosts/architect/default.nix

158 lines
3.8 KiB
Nix
Raw Normal View History

2023-05-12 12:48:45 +01:00
{ config, pkgs, lib, ... }:
2021-07-01 01:02:55 +01:00
2021-07-03 23:43:52 +01:00
let
macbookPubkey = (import ../pubkeys.nix).macbook;
pubkeys = [ macbookPubkey ];
2023-05-12 12:48:45 +01:00
domain = "devs.giugl.io";
2023-05-27 23:16:46 +01:00
utilities = import ./utilities.nix { inherit lib config; };
inherit (utilities) generateDeviceStrings;
2023-02-11 02:29:48 +00:00
in
{
imports = [
./options.nix
2021-11-21 23:41:17 +00:00
./backup.nix
./hardware.nix
./firewall.nix
./nginx.nix
2023-06-05 02:16:19 +01:00
./gitea.nix
2021-11-21 23:41:17 +00:00
./sonarr.nix
./radarr.nix
./bazarr.nix
./nzbget.nix
./nextcloud.nix
./minio.nix
./matrix.nix
./fail2ban.nix
./dns.nix
# ./minecraft.nix
2021-11-21 23:41:17 +00:00
./prowlarr.nix
2024-11-18 19:58:44 +00:00
./redlib.nix
# ./invidious.nix
./jellyfin.nix
# ./docker.nix
./tailscale.nix
2023-05-06 14:04:25 +01:00
./headscale.nix
2023-11-16 12:26:06 +00:00
./llm.nix
# ./photoprism.nix
./sunshine.nix
2024-09-10 15:44:04 +01:00
./jellyseer.nix
./teslamate.nix
./postgres.nix
./netdata.nix
./homeassistant.nix
2021-11-21 23:41:17 +00:00
];
age.identityPaths = [ "/root/.ssh/id_ed25519" ];
2023-05-12 12:48:45 +01:00
architect = {
networks.lan = {
interface = "enp6s0";
2023-05-12 12:48:45 +01:00
net = "10.0.0.0/24";
devices = {
architect = { address = "10.0.0.250"; hostname = "architect.${domain}"; };
router = { address = "10.0.0.1"; hostname = "router.${domain}"; };
dvr = { address = "10.0.0.3"; hostname = "dvr.${domain}"; };
};
};
firewall = {
openTCP = [ 22 ];
};
};
time.timeZone = "Europe/London";
2021-11-21 23:41:17 +00:00
users.users.giulio.openssh.authorizedKeys.keys = pubkeys;
boot = {
initrd = {
availableKernelModules = [ "igc" "r8169" ];
network = {
enable = true;
ssh = {
2021-07-03 23:43:52 +01:00
enable = true;
2021-11-21 23:41:17 +00:00
port = 22;
2022-07-06 19:34:12 +01:00
hostKeys = [ /secrets/ssh_host_rsa_key ];
2021-11-21 23:41:17 +00:00
authorizedKeys = pubkeys;
2021-07-01 01:05:43 +01:00
};
2021-07-03 23:43:52 +01:00
};
2021-07-01 01:05:43 +01:00
};
2022-07-06 19:34:12 +01:00
2023-05-12 12:48:45 +01:00
kernelParams = with config.architect.networks.lan; [
"ip=${devices.architect.address}::${devices.router.address}:255.255.255.0::${interface}:off"
2022-07-06 19:34:12 +01:00
];
kernel.sysctl = { "net.ipv4.ip_forward" = 1; };
2021-07-01 01:05:43 +01:00
2021-11-21 23:41:17 +00:00
loader = {
2022-07-06 19:34:12 +01:00
systemd-boot = {
2022-03-15 15:58:04 +00:00
enable = true;
memtest86.enable = true;
};
2021-11-21 23:41:17 +00:00
efi.canTouchEfiVariables = true;
};
2021-07-03 23:43:52 +01:00
2021-11-21 23:41:17 +00:00
supportedFilesystems = [ "zfs" ];
zfs.requestEncryptionCredentials = true;
2023-05-27 23:16:46 +01:00
tmp.tmpfsSize = "50%";
2021-11-21 23:41:17 +00:00
};
2023-05-12 12:48:45 +01:00
networking = with config.architect.networks.lan; {
hostName = "architect";
2021-11-21 23:41:17 +00:00
hostId = "49350853";
useDHCP = false;
2023-05-12 12:48:45 +01:00
defaultGateway = devices.router.address;
2021-11-21 23:41:17 +00:00
interfaces = {
2023-05-12 12:48:45 +01:00
${interface}.ipv4.addresses = [{
address = devices.architect.address;
2021-11-21 23:41:17 +00:00
prefixLength = 24;
}];
2021-07-03 23:43:52 +01:00
};
2023-05-12 12:48:45 +01:00
extraHosts = (generateDeviceStrings config.architect.networks.lan.devices) + ''
2023-05-12 23:53:17 +01:00
2021-11-21 23:41:17 +00:00
# Blacklist
0.0.0.0 metrics.plex.tv
0.0.0.0 analytics.plex.tv
0.0.0.0 cdn.luckyorange.com
0.0.0.0 w1.luckyorange.com
0.0.0.0 browser.sentry-cdn.com
0.0.0.0 analytics.facebook.com
0.0.0.0 ads.facebook.com
0.0.0.0 extmaps-api.yandex.net
0.0.0.0 logservice.hicloud.com
0.0.0.0 logbak.hicloud.com
0.0.0.0 logservice1.hicloud.com
0.0.0.0 samsung-com.112.2o7.net
0.0.0.0 supportmetrics.apple.com
0.0.0.0 analytics.oneplus.cn
0.0.0.0 click.oneplus.cn
0.0.0.0 analytics-api.samsunghealthcn.com
'';
};
2023-02-14 17:15:12 +00:00
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [ vaapiVdpau ];
2021-11-21 23:41:17 +00:00
};
2021-07-01 01:05:43 +01:00
2021-11-21 23:41:17 +00:00
services = {
2023-02-14 17:14:06 +00:00
fwupd.enable = true;
das_watchdog.enable = true;
2021-11-21 23:41:17 +00:00
zfs.autoScrub.enable = true;
2021-12-19 12:24:19 +00:00
openssh = {
enable = true;
2023-05-27 23:16:46 +01:00
settings = {
2023-05-28 21:45:49 +01:00
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
2023-05-27 23:16:46 +01:00
};
2023-05-28 21:45:49 +01:00
2022-07-06 19:34:12 +01:00
extraConfig = ''
MaxAuthTries 15
'';
2021-12-19 12:24:19 +00:00
};
2021-11-21 23:41:17 +00:00
smartd.enable = true;
};
}
2023-05-12 12:48:45 +01:00