2024-09-28 17:16:27 +02:00
|
|
|
{ lib, inputs, config, pkgs, ... }:
|
2024-09-22 16:27:43 +02:00
|
|
|
let
|
|
|
|
serverIP = "192.168.1.2";
|
|
|
|
in {
|
2024-09-04 22:22:59 +02:00
|
|
|
imports = [
|
|
|
|
(import ../Common/default.nix { inherit inputs pkgs; })
|
2024-11-20 13:59:28 +01:00
|
|
|
(import ../Common/nvidia.nix { inherit inputs pkgs config; })
|
2024-09-04 22:22:59 +02:00
|
|
|
(import ../Common/desktop.nix { inherit inputs pkgs config; })
|
2024-09-22 16:27:43 +02:00
|
|
|
(import ../Common/nfs.nix { inherit pkgs serverIP; })
|
2024-11-20 13:59:28 +01:00
|
|
|
(import ../Common/android.nix { inherit pkgs; })
|
2024-09-04 22:22:59 +02:00
|
|
|
];
|
2024-06-10 12:14:37 +02:00
|
|
|
|
2024-10-28 20:00:55 +01:00
|
|
|
# Kernel
|
2024-12-01 16:13:29 +01:00
|
|
|
# boot.kernelPackages = pkgs.linuxPackages_latest;
|
2024-10-28 20:00:55 +01:00
|
|
|
|
2024-09-04 22:22:59 +02:00
|
|
|
# AMD CPU
|
|
|
|
boot.extraModulePackages = [ config.boot.kernelPackages.zenpower ];
|
|
|
|
boot.kernelModules = [ "zenpower amd_pstate=active" ];
|
2024-12-07 18:34:45 +01:00
|
|
|
# boot.kernelParams = ["amd_pstate=active"];
|
2024-11-20 13:59:28 +01:00
|
|
|
# boot.initrd.kernelModules = [ "amdgpu" ];
|
|
|
|
|
2025-01-17 17:55:34 +01:00
|
|
|
nixpkgs.config.cudaSupport = true;
|
|
|
|
services.ollama = {
|
|
|
|
enable = true;
|
|
|
|
};
|
2024-09-04 22:22:59 +02:00
|
|
|
services.logind.extraConfig = ''HandlePowerKey=suspend'';
|
2024-06-08 17:31:27 +02:00
|
|
|
|
2024-09-13 10:45:22 +02:00
|
|
|
# Virtualization
|
|
|
|
virtualisation.libvirtd.enable = true;
|
|
|
|
virtualisation.spiceUSBRedirection.enable = true;
|
|
|
|
programs.virt-manager.enable = true;
|
|
|
|
users.users.user.extraGroups = [ "libvirtd" ];
|
|
|
|
|
2024-09-04 22:22:59 +02:00
|
|
|
networking.wg-quick.interfaces = {
|
|
|
|
wg0 = {
|
|
|
|
address = [ "10.0.0.10/24" " 2a02:a03f:83ad:2101::2/128" ];
|
|
|
|
dns = [ "10.0.0.1" "fdc9:281f:04d7:9ee9::1" ];
|
|
|
|
privateKeyFile = "/home/user/.secrets/Wireguard/Kell.key";
|
|
|
|
listenPort = 51820;
|
|
|
|
peers = [{
|
|
|
|
publicKey = "/9ppjm3yeD0duDvxrqgcHscHmftXko+0s2RbivNEy2c=";
|
|
|
|
allowedIPs = [ "10.0.0.1/8" ];
|
|
|
|
endpoint = "192.168.1.1:13231";
|
|
|
|
}];
|
|
|
|
};
|
2024-06-03 16:02:50 +02:00
|
|
|
};
|
2024-09-28 17:16:27 +02:00
|
|
|
|
|
|
|
networking.bridges = {
|
|
|
|
"br0" = {
|
2025-01-20 21:54:39 +01:00
|
|
|
interfaces = [ "enp5s0" ];
|
2024-09-28 17:16:27 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
networking.interfaces.br0.useDHCP = lib.mkDefault true;
|
|
|
|
networking.interfaces.wlan0.useDHCP = lib.mkDefault true;
|
2025-01-20 21:54:39 +01:00
|
|
|
boot.kernel.sysctl."net.ipv6.conf.enp5s0.disable_ipv6" = true;
|
2024-09-28 17:16:27 +02:00
|
|
|
|
2024-09-04 22:22:59 +02:00
|
|
|
networking.wireless.iwd.enable = true;
|
|
|
|
networking.wireless.iwd.settings = {
|
|
|
|
IPv6 = {
|
|
|
|
Enabled = true;
|
|
|
|
};
|
|
|
|
Settings = {
|
|
|
|
AutoConnect = true;
|
|
|
|
};
|
2024-07-06 13:21:49 +02:00
|
|
|
};
|
2024-09-04 22:22:59 +02:00
|
|
|
|
2024-09-28 17:16:27 +02:00
|
|
|
|
|
|
|
# Programs & Services
|
|
|
|
programs.gnupg.agent.enable = true;
|
2024-09-04 22:22:59 +02:00
|
|
|
services.sunshine = {
|
|
|
|
enable = true;
|
2024-09-28 17:16:27 +02:00
|
|
|
autoStart = false;
|
2024-09-04 22:22:59 +02:00
|
|
|
capSysAdmin = true;
|
|
|
|
openFirewall = true;
|
2024-07-06 13:21:49 +02:00
|
|
|
};
|
2024-12-01 16:13:29 +01:00
|
|
|
programs.steam = {
|
|
|
|
enable = true;
|
|
|
|
gamescopeSession.enable = true;
|
|
|
|
};
|
2024-12-07 18:34:45 +01:00
|
|
|
|
2024-12-19 19:31:31 +01:00
|
|
|
specialisation = {
|
|
|
|
vfio.configuration = {
|
|
|
|
boot.blacklistedKernelModules = [ "k10temp" "nvidia" "nouveau" "radeon" "amdgpu"];
|
|
|
|
boot = {
|
|
|
|
initrd.kernelModules = [
|
|
|
|
"kvm-amd"
|
|
|
|
"vfio_pci"
|
|
|
|
"vfio"
|
|
|
|
"vfio_iommu_type1"
|
|
|
|
# "amdgpu"
|
|
|
|
# "nvidia_modeset"
|
|
|
|
# "nvidia"
|
|
|
|
# "nvidia_uvm"
|
|
|
|
# "nvidia_drm"
|
|
|
|
];
|
|
|
|
kernelParams = [
|
|
|
|
"amd_pstate=active"
|
|
|
|
"amd_iommu=on"
|
2025-01-20 21:54:39 +01:00
|
|
|
"vfio-pci.ids=10de:1b80,10de:10f0,1002:67df,1002:aaf0,1002:687f,1002:aaf8"
|
2024-12-19 19:31:31 +01:00
|
|
|
];
|
|
|
|
postBootCommands = ''
|
|
|
|
DEVS="0000:0b:00.0 0000:0b:00.1 0000:05:00.0 0000:05:00.1
|
|
|
|
for DEV in $DEVS; do
|
|
|
|
echo "vfio-pci" > /sys/bus/pci/devices/$DEV/driver_override
|
|
|
|
done
|
|
|
|
modprobe -i vfio-pci
|
|
|
|
'';
|
|
|
|
};
|
2025-01-20 21:54:39 +01:00
|
|
|
boot.extraModprobeConfig = "options vfio-pci ids=10de:1b80,10de:10f0,1002:67df,1002:aaf0,1002:687f,1002:aaf8";
|
2024-12-19 19:31:31 +01:00
|
|
|
services.greetd.enable = lib.mkForce false;
|
|
|
|
};
|
2025-01-17 17:55:34 +01:00
|
|
|
vfio-nvidia.configuration = {
|
|
|
|
boot.blacklistedKernelModules = [ "k10temp" "nvidia" "nouveau" ];
|
|
|
|
boot = {
|
|
|
|
initrd.kernelModules = [
|
|
|
|
"kvm-amd"
|
|
|
|
"vfio_pci"
|
|
|
|
"vfio"
|
|
|
|
"vfio_iommu_type1"
|
|
|
|
"amdgpu"
|
|
|
|
];
|
|
|
|
kernelParams = [
|
|
|
|
"amd_pstate=active"
|
|
|
|
"amd_iommu=on"
|
|
|
|
"vfio-pci.ids=10de:1b80,10de:10f0"
|
|
|
|
];
|
|
|
|
postBootCommands = ''
|
|
|
|
DEVS="0000:0b:00.0 0000:0b:00.1
|
|
|
|
for DEV in $DEVS; do
|
|
|
|
echo "vfio-pci" > /sys/bus/pci/devices/$DEV/driver_override
|
|
|
|
done
|
|
|
|
modprobe -i vfio-pci
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
boot.extraModprobeConfig = "options vfio-pci ids=10de:1b80,10de:10f0";
|
|
|
|
};
|
2024-12-07 18:34:45 +01:00
|
|
|
};
|
2024-06-02 16:36:56 +02:00
|
|
|
}
|