2023-12-04 03:55:18 +01:00
|
|
|
{ inputs, config, lib, pkgs, modulesPath, desktop, username, ... }: {
|
2023-11-25 07:17:29 +01:00
|
|
|
imports = [
|
2023-11-25 14:57:30 +01:00
|
|
|
# inputs.nixos-hardware.nixosModules.framework-13-inch-13th-gen-intel
|
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")
|
|
|
|
./disks.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
|
2023-11-25 07:17:29 +01:00
|
|
|
../../common/services/fwupd.nix
|
2023-11-29 10:07:39 +01:00
|
|
|
./builder.nix
|
2023-11-29 12:31:44 +01:00
|
|
|
./ssh-luks.nix
|
2023-11-29 10:07:39 +01:00
|
|
|
./docker.nix
|
2023-12-01 13:25:48 +01:00
|
|
|
./wireguard.nix
|
2023-12-06 03:56:24 +01:00
|
|
|
./cron.nix
|
2023-12-05 12:35:29 +01:00
|
|
|
] ++ lib.optional (builtins.isString desktop) ./rdesktop.nix;
|
2023-11-25 07:17:29 +01:00
|
|
|
|
|
|
|
# steam , etc
|
2023-12-04 03:56:02 +01:00
|
|
|
nixpkgs.config.allowUnfree = true;
|
2023-11-25 07:17:29 +01:00
|
|
|
|
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;
|
|
|
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
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
|
|
|
|
|
|
|
# Generic Tailscale configs are in /nixos/common/services/tailscale.nix
|
|
|
|
# Set up the secrets file:
|
|
|
|
sops.secrets."tailscale_keys/framework-server" = {
|
|
|
|
owner = "root";
|
|
|
|
sopsFile = ../../../secrets/tailscale.yaml;
|
|
|
|
restartUnits = [
|
|
|
|
"tailscaled.service"
|
|
|
|
"tailscaled-autoconnect.service"
|
|
|
|
];
|
|
|
|
};
|
2023-12-02 14:51:23 +01:00
|
|
|
services.tailscale.authKeyFile = "/run/secrets/tailscale_keys/framework-server";
|
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
|
|
|
}
|