Skip to content

Commit

Permalink
feat: upgrade pc and migrated to linux gaming
Browse files Browse the repository at this point in the history
  • Loading branch information
Wittano committed Dec 15, 2024
1 parent 9f022c4 commit 863dafe
Show file tree
Hide file tree
Showing 15 changed files with 112 additions and 104 deletions.
80 changes: 40 additions & 40 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion home-manager/games.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let
# Games
osu-lazer # osu!lazer
# airshipper # Veloren
fixedMindustry # Mindustry
mindustry # Mindustry
xivlauncher # FF XIV
prismlauncher
];
Expand Down
23 changes: 12 additions & 11 deletions hosts/pc/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ rec {
# Nix configuration
nix = {
settings = {
max-jobs = 4;
cores = 4;
max-jobs = 24;
cores = 24;
auto-optimise-store = true;
};
gc = {
Expand Down Expand Up @@ -114,10 +114,11 @@ rec {
keyboard.zsa.enable = true;

virtualization.wittano = {
enable = true;
enableWindowsVM = true;
enable = false;
enableWindowsVM = false;
};
nvidia.enable = true;
# nvidia.enable = true;
amd.enable = true;
samba.enable = true;
printers.wittano.enable = true;
bluetooth.wittano.enable = true;
Expand Down Expand Up @@ -153,9 +154,9 @@ rec {
file-roller.enable = true; # Archive explorer
evince.enable = true; # PDF viever
# droidcam.enable = true; # FIXME Problem with sharing Video phone <-> pc. ONLY ON LINUX
steam.wittano.enable = false;
steam.wittano.enable = true;
mihoyo = {
enable = false;
enable = true;
games = [ "honkai-railway" ];
};
};
Expand Down Expand Up @@ -248,8 +249,8 @@ rec {
desktopName = "qtile";
};

games.enable = false;
lutris.enable = false;
games.enable = true;
lutris.enable = true;

tmux.wittano.enable = true;
neovim.wittano.enable = true;
Expand Down Expand Up @@ -333,7 +334,7 @@ rec {


services = {
prometheus.wittano.enable = true;
prometheus.wittano.enable = false;
pipewire.wittano.enable = true;
udisks2 = {
enable = true;
Expand Down Expand Up @@ -365,7 +366,7 @@ rec {
};

boinc.wittano.enable = !hardware.virtualization.wittano.enableWindowsVM;
backup.enable = true;
# backup.enable = true;
rss.enable = true;
syncthing.wittano.enable = true;
filebot.wittano.enable = true;
Expand Down
3 changes: 0 additions & 3 deletions hosts/pc/hardware.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{ ... }: {
hardware.cpu.intel.updateMicrocode = true;

fileSystems = {
"/" = {
device = "/dev/disk/by-label/ROOT";
Expand All @@ -11,5 +9,4 @@
fsType = "vfat";
};
};
swapDevices = [{ device = "/dev/disk/by-label/SWAP"; }];
}
17 changes: 2 additions & 15 deletions hosts/pc/networking.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
{ lib, config, ... }:
{ lib, ... }:
with lib;
{
networking = {
interfaces.eno1.ipv4.addresses = mkIf config.hardware.virtualization.wittano.enableWindowsVM [
{
address = "192.168.1.180";
prefixLength = 24;
}
];
nameservers = [ "1.1.1.1" ];
defaultGateway = mkIf config.hardware.virtualization.wittano.enableWindowsVM {
address = "192.168.1.1";
interface = "eno1";
};
dhcpcd.enable = mkForce true;
};
networking.dhcpcd.enable = mkForce true;
}
15 changes: 15 additions & 0 deletions nixos/hardware/amd.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{ config, lib, ... }:
with lib;
with lib.my;
let
cfg = config.hardware.amd;
in
{
options.hardware.amd.enable = mkEnableOption "Enable nvidia drivers";

config = mkIf cfg.enable {
services.xserver.videoDrivers = mkIf config.services.xserver.enable [ "amd" ];

boot.initrd.kernelModules = [ "amdgpu" ];
};
}
1 change: 1 addition & 0 deletions nixos/hardware/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
./bootloader.nix
./docker.nix
./nvidia.nix
./amd.nix
./printer.nix
./samba.nix
./pipewire.nix
Expand Down
1 change: 1 addition & 0 deletions nixos/hardware/pipewire.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ in
environment.systemPackages = with pkgs; [ pulseaudio ];

security.rtkit.enable = true;
hardware.enableAllFirmware = cfg.enable;
services.pipewire = rec {
enable = cfg.enable;
alsa.enable = enable;
Expand Down
Binary file added nixos/hardware/virtualization/amd.vibios.rom
Binary file not shown.
20 changes: 12 additions & 8 deletions nixos/hardware/virtualization/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ in

system.activationScripts.installWindowsVMFiles = link.mkLinks [
{
src = ./vibios.rom;
dest = "/var/lib/libvirt/vbios/vibios.rom";
src = ./amd.vibios.rom;
dest = "/var/lib/libvirt/vbios/amd.vibios.rom";
active = cfg.enableWindowsVM;
}
{
Expand All @@ -168,16 +168,20 @@ in
];

boot = {
kernelParams = [ "intel_iommu=on" "iommu=pt" ];
kernelModules = [ "kvm-intel" "vifo-pci" ];
kernelParams = [ "amd_iommu=on" "iommu=pt" "iommu=1" ];
kernelModules = [ "vifo-pci" "vendor-reset" ];
extraModulePackages = with config.boot.kernelPackages; [ vendor-reset ];
};

services.ssh.wittano.enable = true;

services.udev.extraRules = mkIf cfg.enableWindowsVM ''
ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", RUN+="${pkgs.bash}/bin/bash -c '${meta.getExe usbMountScript} ''$attr{idProduct} ''$attr{idVendor}'"
ACTION=="remove", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", RUN+="${meta.getExe unmountScript}"
'';
services.udev = {
packages = with config.boot.kernelPackages; [ vendor-reset ];
extraRules = mkIf cfg.enableWindowsVM ''
ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", RUN+="${pkgs.bash}/bin/bash -c '${meta.getExe usbMountScript} ''$attr{idProduct} ''$attr{idVendor}'"
ACTION=="remove", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", RUN+="${meta.getExe unmountScript}"
'';
};
};
}

File renamed without changes.
Loading

0 comments on commit 863dafe

Please sign in to comment.