nix/nixos/hosts/framework-server/default.nix

66 lines
2.5 KiB
Nix
Raw Normal View History

2024-03-21 10:51:41 +01:00
{ inputs, config, lib, pkgs, modulesPath, system, ... }: {
2023-11-25 07:17:29 +01:00
imports = [
2023-11-26 06:44:52 +01:00
inputs.nixos-hardware.nixosModules.framework-13th-gen-intel
2023-11-25 07:17:29 +01:00
(modulesPath + "/installer/scan/not-detected.nix")
2023-11-30 12:33:54 +01:00
../../common/modules/secureboot.nix
2023-12-06 07:32:21 +01:00
../../common/modules/udev-rules.nix
2024-04-21 05:24:24 +02:00
../../common/modules/builder.nix
2023-11-25 07:17:29 +01:00
../../common/services/fwupd.nix
2023-12-17 12:52:40 +01:00
../../common/modules/ssh-luks.nix
../../common/services/docker.nix
../../common/services/tailscale-autoconnect.nix
2024-03-20 09:23:30 +01:00
./containers.nix
./disks.nix
2023-12-01 13:25:48 +01:00
./wireguard.nix
2023-12-06 03:56:24 +01:00
./cron.nix
2023-12-19 13:27:26 +01:00
./firewall.nix
./fail2ban/traefik.nix
2023-12-18 09:50:52 +01:00
];
2023-11-25 07:17:29 +01:00
2024-03-20 09:23:30 +01:00
environment.systemPackages = [
inputs.deploy-rs.packages.${system}.deploy-rs
pkgs.distrobox
];
2023-12-11 11:52:52 +01:00
2024-03-13 03:48:40 +01:00
# backups-rpi4 cron job to back up sysctl.io's Docker files
# osaka-linode-01 cron job to copy certs for the DERP relay
2024-03-15 02:38:02 +01:00
# milan-linode-01 cron job to copy certs for the DERP relay
2024-06-23 13:09:09 +02:00
# frankfurt-linode-01 cron job to copy certs for the DERP relay
2024-07-16 14:03:56 +02:00
# warsaw-ovh-01 - copy /Storage
2024-03-13 03:48:40 +01:00
users.users.root.openssh.authorizedKeys.keys = [
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKp2wgqFcr0LGaUXbom88/zK2631pysePUWIaCMljT0K root@backups-rpi4''
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKkNFdEcYIrjss1Nz0tU/AX89hUMmxB/Vabvsa7A6E2K root@osaka-linode-01''
2024-03-15 05:53:48 +01:00
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIORCrD/ZWXbAfi5eIN8b9dwuvMuPPTgpMiIFh1WagXV2 root@milan-linode-01''
2024-06-24 14:44:08 +02:00
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBGXiWUR2T5HXQ4g/En+eJ9K6GSokl3tEK7RZcYb+0UA root@frankfurt-linode-01''
2024-07-16 14:03:56 +02:00
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIcGPkzFaSGd1q/oy/uP5zEoOuPNr1h17ifu7oj4DaYO root@warsaw-ovh-01''
2024-03-13 03:48:40 +01:00
];
2024-08-05 04:46:09 +02:00
# Allow root login, but only with SSH keys
2023-12-30 14:35:19 +01:00
services.openssh.settings.PermitRootLogin = lib.mkForce "prohibit-password";
2023-11-26 03:01:38 +01:00
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "thunderbolt" "sd_mod" "uas" ];
2023-12-02 03:24:49 +01:00
boot.initrd.kernelModules = [ "r8152" ];
2023-11-26 03:01:38 +01:00
boot.kernelModules = [ "kvm-intel" ];
2023-11-30 12:20:41 +01:00
boot.extraModulePackages = with config.boot.kernelPackages; [ acpi_call ];
2023-11-25 07:17:29 +01:00
networking.useDHCP = lib.mkDefault true;
2023-11-26 03:01:38 +01:00
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
2023-11-25 07:17:29 +01:00
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# Set your time zone.
time.timeZone = "Asia/Tokyo";
# Set the networking hostname:
2023-11-25 11:04:12 +01:00
networking.hostName = "framework-server";
2023-11-25 07:17:29 +01:00
networking.firewall.allowedTCPPorts = [ 22 ];
2023-12-01 09:56:08 +01:00
2023-12-02 14:36:39 +01:00
services.tailscale.extraUpFlags = [
"--advertise-exit-node"
"--advertise-routes=10.2.0.0/24"
];
2023-12-04 09:25:02 +01:00
boot.kernel.sysctl = {
"net.ipv4.ip_forward" = true;
};
2023-12-02 14:36:39 +01:00
}