nixos/hosts/architect/default.nix

158 lines
4.6 KiB
Nix
Raw Normal View History

2021-07-13 09:53:22 +01:00
{ config, pkgs, ... }:
2021-07-01 01:02:55 +01:00
2021-07-03 23:43:52 +01:00
let
2021-11-21 23:41:17 +00:00
pubkeys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC1we38/N+t8Ah5yrLof8QUwhrob7/VXFKIddaJeOVBLuDVnW7ljiAtdtEiL69D/DV4Ohmt5wMvkAAjfuHmim6FD9A6lzPbSU4KH9W2dcckszKbbI636kuDwem/xui6BW3wJa6P+0xW5ksygEAkzcK2PXuC2b4B9uwhuUdKahiGMKDxISG/WianqAe72cGMfNkYvion3Y1VsMLUdm48d2ABnxNpr7NI9B5iJ8dziOft9gpgfz13CCQRlReo75gk/4xI+vSNrQp7eR+wzJy2/dZg/T8jtyA9Q6jVxrxBpqQ1LNXkAKaJkGo9OabF6Wgpzp+YTAurL4nwR2NaJxwFuyoKvACQy0ai4jrS3206gC6JXZv8ktZMZrwUN+jPqCwfgh5qObFkAqKCxbp52ioDek2MQLdOvzQBX//DBhGEp5rzHGLZ3vhRIiiQiaof5sF5zWiYDW5mqezSPNxJPX/BrTP/Wbs/jpwTLBh3wytiia0S1WXQmya89bqzTPFiDWvTRA62EVKB/JaQtPQQOFAxWwg799DMycPeZ81xttZOyMtI/MZSddyqx2S8fWGwvToZQvuZ38mSIpFseLM1IkgabRIrAmat5SBNGGy9Dqa0eMEa7bwIY/4CMB1y6HMTnaoMXA6cnQfHMoB/zyTZ6oTXIeqeOyiZsK+RN0Mvahj8mXi7dw== giulio@giulio-X230"
];
hostname = "architect";
network = import ./network.nix;
2021-11-21 23:41:17 +00:00
in {
imports = [ # Include the results of the hardware scan.
./backup.nix
./hardware.nix
./firewall.nix
./nginx.nix
./gitea.nix
./sonarr.nix
./radarr.nix
./bazarr.nix
./nzbget.nix
./nextcloud.nix
./wireguard.nix
./minio.nix
./matrix.nix
./fail2ban.nix
./dns.nix
2022-03-15 15:58:04 +00:00
#./minecraft.nix
2021-11-21 23:41:17 +00:00
./prowlarr.nix
2022-04-05 13:04:53 +01:00
# ./plex.nix
2021-11-21 23:41:17 +00:00
./githubrunner.nix
./libreddit.nix
./invidious.nix
./nitter.nix
./ccache.nix
2022-02-15 10:58:08 +00:00
./lidarr.nix
./navidrome.nix
./jellyfin.nix
./prosody.nix
2022-03-15 15:58:04 +00:00
./deluge.nix
2022-04-05 13:04:53 +01:00
# ./calibre.nix
../../cachix.nix
2021-11-21 23:41:17 +00:00
];
time.timeZone = "Europe/Rome";
system.stateVersion = "21.11"; # Did you read the comment?
2021-11-21 23:41:17 +00:00
users.users.giulio.openssh.authorizedKeys.keys = pubkeys;
2021-12-08 15:45:21 +00:00
services.fwupd.enable = true;
2021-11-21 23:41:17 +00:00
boot = {
2021-12-08 15:45:21 +00:00
kernelParams = [
"ip=${network.architect-lan}::10.0.0.1:255.255.255.0::${network.wan-if}:off"
2021-12-08 15:45:21 +00:00
"nvme_core.default_ps_max_latency_us=5500"
];
2022-02-15 10:58:08 +00:00
kernel.sysctl= {
"net.ipv4.ip_forward" = 1;
"fs.protected_regular" = 0;
};
2021-11-21 23:41:17 +00:00
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;
hostKeys = [ /boot/ssh_host_rsa_key ];
authorizedKeys = pubkeys;
2021-07-01 01:05:43 +01:00
};
2021-11-21 23:41:17 +00:00
postCommands = ''
zpool import backedpool
zpool import zpool
2021-07-03 23:43:52 +01:00
2021-11-21 23:41:17 +00:00
mkdir /mnt-root
echo "zfs load-key -ar; mount -t zfs zpool/nixos/root /mnt-root; zfs load-key -a; umount /mnt-root; rmdir /mnt-root; killall zfs" >> /root/.profile
'';
2021-07-03 23:43:52 +01:00
};
2021-07-01 01:05:43 +01:00
};
2021-11-21 23:41:17 +00:00
loader = {
2022-03-15 15:58:04 +00:00
systemd-boot ={
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;
2022-02-15 10:58:08 +00:00
tmpOnTmpfsSize = "80%";
2021-11-21 23:41:17 +00:00
};
networking = {
hostName = hostname;
hostId = "49350853";
useDHCP = false;
defaultGateway = "10.0.0.1";
interfaces = {
enp5s0.ipv4.addresses = [{
address = network.architect-lan;
2021-11-21 23:41:17 +00:00
prefixLength = 24;
}];
enp6s0.useDHCP = false;
wlp4s0.useDHCP = false;
2021-07-03 23:43:52 +01:00
};
2021-11-21 23:41:17 +00:00
extraHosts = ''
127.0.0.1 ${hostname}.devs.giugl.io localhost
# LAN
${network.architect-lan} ${hostname}.devs.giugl.io
2021-11-21 23:41:17 +00:00
${network.dvr-lan} dvr.devs.giugl.io
${network.nas-lan} nas.devs.giugl.io
2022-02-15 10:58:08 +00:00
192.168.1.1 vodafone.station
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
'';
};
environment.systemPackages = with pkgs; [ cudatoolkit cachix ];
2021-11-21 23:41:17 +00:00
hardware = {
opengl.enable = true;
opengl.extraPackages = with pkgs; [ vaapiVdpau ];
opengl.driSupport = true;
};
2021-07-01 01:05:43 +01:00
2021-11-21 10:37:18 +00:00
services.das_watchdog.enable = true;
2021-11-21 23:41:17 +00:00
services = {
zfs.autoScrub.enable = true;
xserver.videoDrivers = [ "nvidia" ];
2021-12-19 12:24:19 +00:00
openssh = {
enable = true;
passwordAuthentication = false;
challengeResponseAuthentication = false;
};
2021-11-21 23:41:17 +00:00
smartd.enable = true;
};
2021-07-03 23:43:52 +01:00
2021-11-21 23:41:17 +00:00
environment.variables = { LIBVA_DRIVER_NAME = "vdpau"; };
}