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

68 lines
2.6 KiB
Nix
Raw Normal View History

2024-03-21 18:51:41 +09:00
{ inputs, config, lib, pkgs, modulesPath, system, ... }: {
2023-11-25 15:17:29 +09:00
imports = [
2023-11-26 14:44:52 +09:00
inputs.nixos-hardware.nixosModules.framework-13th-gen-intel
2023-11-25 15:17:29 +09:00
(modulesPath + "/installer/scan/not-detected.nix")
2023-11-30 20:33:54 +09:00
../../common/modules/secureboot.nix
2023-12-06 15:32:21 +09:00
../../common/modules/udev-rules.nix
2024-04-21 12:24:24 +09:00
../../common/modules/builder.nix
2023-11-25 15:17:29 +09:00
../../common/services/fwupd.nix
2023-12-17 20:52:40 +09:00
../../common/modules/ssh-luks.nix
../../common/services/docker.nix
../../common/services/tailscale-autoconnect.nix
# Disabling -- I don't know why but this all of a sudden breaks Headscale.
# Sep 12 2024
# ../../common/modules/fail2ban/traefik.nix
2024-03-20 17:23:30 +09:00
./containers.nix
./disks.nix
2023-12-01 21:25:48 +09:00
./wireguard.nix
2023-12-06 11:56:24 +09:00
./cron.nix
2023-12-19 21:27:26 +09:00
./firewall.nix
2023-12-18 17:50:52 +09:00
];
2023-11-25 15:17:29 +09:00
2024-03-20 17:23:30 +09:00
environment.systemPackages = [
inputs.deploy-rs.packages.${system}.deploy-rs
pkgs.distrobox
];
2023-12-11 19:52:52 +09:00
2024-03-13 11:48:40 +09: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 10:38:02 +09:00
# milan-linode-01 cron job to copy certs for the DERP relay
2024-06-23 20:09:09 +09:00
# frankfurt-linode-01 cron job to copy certs for the DERP relay
2024-07-16 21:03:56 +09:00
# warsaw-ovh-01 - copy /Storage
2024-03-13 11:48:40 +09: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 13:53:48 +09:00
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIORCrD/ZWXbAfi5eIN8b9dwuvMuPPTgpMiIFh1WagXV2 root@milan-linode-01''
2024-06-24 21:44:08 +09:00
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBGXiWUR2T5HXQ4g/En+eJ9K6GSokl3tEK7RZcYb+0UA root@frankfurt-linode-01''
2024-07-16 21:03:56 +09:00
''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIcGPkzFaSGd1q/oy/uP5zEoOuPNr1h17ifu7oj4DaYO root@warsaw-ovh-01''
2024-03-13 11:48:40 +09:00
];
2024-08-05 11:46:09 +09:00
# Allow root login, but only with SSH keys
2023-12-30 22:35:19 +09:00
services.openssh.settings.PermitRootLogin = lib.mkForce "prohibit-password";
2023-11-26 11:01:38 +09:00
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "thunderbolt" "sd_mod" "uas" ];
2023-12-02 11:24:49 +09:00
boot.initrd.kernelModules = [ "r8152" ];
2023-11-26 11:01:38 +09:00
boot.kernelModules = [ "kvm-intel" ];
2023-11-30 20:20:41 +09:00
boot.extraModulePackages = with config.boot.kernelPackages; [ acpi_call ];
2023-11-25 15:17:29 +09:00
networking.useDHCP = lib.mkDefault true;
2023-11-26 11:01:38 +09:00
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
2023-11-25 15:17:29 +09: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 19:04:12 +09:00
networking.hostName = "framework-server";
2023-11-25 15:17:29 +09:00
networking.firewall.allowedTCPPorts = [ 22 ];
2023-12-01 17:56:08 +09:00
2023-12-02 22:36:39 +09:00
services.tailscale.extraUpFlags = [
"--advertise-exit-node"
"--advertise-routes=10.2.0.0/24"
];
2023-12-04 17:25:02 +09:00
boot.kernel.sysctl = {
"net.ipv4.ip_forward" = true;
};
2023-12-02 22:36:39 +09:00
}