{ config, lib, pkgs, inputs, ... }: { imports = with inputs.nixos-hardware.nixosModules; [ common-cpu-amd common-gpu-amd common-pc-ssd ]; fileSystems = { "/" = { device = "/dev/disk/by-label/root"; fsType = "btrfs"; }; "/boot" = { device = "/dev/disk/by-label/boot"; fsType = "vfat"; }; "/mnt/Storage" = { device = "/dev/disk/by-label/storage"; fsType = "ext4"; }; }; environment.systemPackages = with pkgs; [ gajim-mainwindow virt-manager qemu scream replaysorcery # Custom package #evdev-proxy # Custom package vfio-isolate # Custom Package steam-wrapped discord-wrapped # Custom package mumble piper trackma # Custom package anime-dl # Custom package thunderbird #multimc-wrapped # Custom package #nwg-launchers gnome-podcasts cantata newsflash sublime-music-no-test anki #psst ]; ptw = { programs = { mpv = { primaryScreen = "C27F398"; enable = true; }; #sway.enable = true; alacritty.enable = true; emacs.enable = true; firefox.enable = true; git.enable = true; #gnome-terminal.enable = true; tmux.enable = true; waybar = { enable = true; output = "DP-2"; }; #xournalpp.enable = true; zsh.enable = true; #office.enable = true; #plasma.enable = true; gaming.enable = true; }; services = { gamemode.enable = true; gnome.enable = true; kanshi = let horizontal = "Samsung Electric Company C27F398 H4ZR101145"; vertical = "Goldstar Company Ltd IPS235 305NDPHKN600"; helpers = import ../lib/helpers/kanshi.nix; mkProfile = helpers.mkProfile; wallpaperScript = helpers.mkWallpaperScript { inherit pkgs config; }; in { enable = true; profiles = { homeMultihead = mkProfile { outputs = [ { criteria = vertical; status = "enable"; mode = "1920x1080"; transform = "90"; position = "-1080,0"; } { criteria = horizontal; status = "enable"; mode = "1920x1080"; position = "0,0"; } ]; name = "homeMultihead"; script = wallpaperScript; }; }; }; #swaync.enable = true; key-mapper.enable = true; }; system = { i18n.enable = true; singleUser = "alexander"; primaryInterface = "enp6s0"; hostName = "miku"; offloading.builder.enable = true; }; virtualisation = { enable = true; gaming.enable = true; }; }; programs = { adb.enable = true; gnupg.agent.pinentryFlavor = "qt"; }; virtualisation = { podman = { enable = true; dockerCompat = true; }; }; boot = { extraModprobeConfig = '' options kvm_amd nested=1 options vfio-pci ids=1002:67df,1002:aaf0 options amdgpu dpm=0 ''; initrd = { availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" "amdgpu" "vendor-reset" ]; kernelModules = [ "amdgpu" # GPU (duh) "kvm-amd" "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" # Virt "uinput" # key-mapper "vendor-reset" ]; }; kernelParams = [ "amd_iommu=on" "iommu=pt" "sysrq_always_enabled=1" "kvm.ignore_msrs=1" "kvm.report_ignored_msrs=N" "fbcon=rotate:3" "quiet" "nopti" "nospectre_v2" "nospec" "clocksource=tsc" "tsc=reliable" ]; extraModulePackages = [ pkgs.linuxPackages_zen.vendor-reset ]; #extraModulePackages = [ pkgs.linuxPackages.vendor-reset ]; # NOTE: A regression appears to have happend between 5.10 and 5.12 # which leads to the RX590 to have the fence fallback timer on # sdma0 time out (whatever this means). Maybe bisect? kernelPackages = pkgs.linuxPackages_zen; }; services = { ratbagd.enable = true; flatpak.enable = true; etesync-dav.enable = true; connman.extraConfig = '' WriteResolvConf=false ''; xserver = { enable = true; layout = "de"; libinput.enable = true; displayManager.gdm = { wayland = true; enable = true; }; }; }; hardware = { opentabletdriver.enable = true; }; # TODO: Move into modules systemd = { services = { enable-vendor-reset = { wantedBy = [ "default.target" ]; script = '' echo "device_specific" > /sys/bus/pci/devices/0000:01:00.0/reset_method ''; serviceConfig = { Type = "simple"; }; }; }; user.services = { scream = { description = "Audio receiver for the Scream virtual network sound card"; #wantedBy = [ "default.target" ]; serviceConfig = { Type = "simple"; ExecStart = "${pkgs.scream}/bin/scream -i virbr0 -o pulse"; Restart = "always"; }; }; replaysorcery-kms = { description = "An open-source, instant-replay solution for Linux; KMS service"; #wantedBy = [ "default.target" ]; serviceConfig = { Type = "simple"; ExecStart = "${pkgs.replaysorcery}/bin/replay-sorcery kms-service"; Restart = "always"; }; }; replaysorcery = { description = "An open-source, instant-replay solution for Linux"; #wantedBy = [ "default.target" ]; requires = [ "replaysorcery-kms.service" ]; serviceConfig = { Type = "simple"; ExecStart = "${pkgs.replaysorcery}/bin/replay-sorcery"; Restart = "always"; }; }; }; }; }