104 lines
2.6 KiB
Nix
104 lines
2.6 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
imports = [
|
|
../modules/backup.nix
|
|
../modules/blog.nix
|
|
../modules/code.nix
|
|
../modules/desktop.nix
|
|
../modules/mail.nix
|
|
../modules/music.nix
|
|
../modules/photo.nix
|
|
../modules/ssh.nix
|
|
../modules/vault.nix
|
|
../lilac.nix
|
|
];
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
whipper
|
|
restic
|
|
];
|
|
|
|
networking = {
|
|
hostName = "desktop";
|
|
|
|
firewall = {
|
|
enable = true;
|
|
allowedUDPPorts = [ 51820 ];
|
|
trustedInterfaces = [ "wg0" ];
|
|
};
|
|
|
|
wireguard.interfaces."wg0" = {
|
|
ips = [ "10.0.0.2/32" ];
|
|
generatePrivateKeyFile = true;
|
|
privateKeyFile = "/var/lib/wireguard/wg0.key";
|
|
peers = [{
|
|
publicKey = "Tst6SiqoGLSoOAF9l5vT2vvR2RGJ/mFcoBL3BL5n90k=";
|
|
allowedIPs = [ "10.0.0.0/24" ];
|
|
endpoint = "216.128.177.13:51820";
|
|
persistentKeepalive = 25;
|
|
}];
|
|
};
|
|
};
|
|
|
|
programs.steam.enable = true;
|
|
|
|
time.timeZone = "America/Toronto";
|
|
|
|
services.displayManager.autoLogin.enable = true;
|
|
services.displayManager.autoLogin.user = "lilac";
|
|
|
|
systemd.sleep.settings.Sleep = {
|
|
AllowSuspend = "no";
|
|
AllowHibernation = "no";
|
|
AllowHybridSleep = "no";
|
|
AllowSuspendThenHibernate = "no";
|
|
};
|
|
|
|
systemd.services.amdgpu-performance = {
|
|
description = "Force AMD GPU performance level to high";
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
ExecStart = ''
|
|
${pkgs.bash}/bin/bash -c '
|
|
for gpu in /sys/class/drm/card*/device; do
|
|
if [ -f "$gpu/vendor" ] && [ "$(cat "$gpu/vendor")" = "0x1002" ]; then
|
|
echo high > "$gpu/power_dpm_force_performance_level"
|
|
fi
|
|
done
|
|
'
|
|
'';
|
|
};
|
|
};
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
system.stateVersion = "26.05";
|
|
|
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "sd_mod" ];
|
|
boot.initrd.kernelModules = [ ];
|
|
boot.kernelModules = [ ];
|
|
boot.extraModulePackages = [ ];
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
|
boot.kernelParams = [ "amdgpu.runpm=0" ];
|
|
|
|
fileSystems."/" = {
|
|
device = "/dev/disk/by-uuid/d7450680-7d53-4842-83c5-7fc32526dff1";
|
|
fsType = "ext4";
|
|
};
|
|
fileSystems."/boot" = {
|
|
device = "/dev/disk/by-uuid/D148-4AB8";
|
|
fsType = "vfat";
|
|
options = [ "fmask=0077" "dmask=0077" ];
|
|
};
|
|
swapDevices = [ ];
|
|
|
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
}
|