{ config, pkgs, lib, ... }: let my-overlay = self: super: { xow = super.xow.overrideAttrs (o: rec { # src = ../xow-src/.; patches = [../patches/xow/0001-Single-controller-patch.patch]; }); my-linuxPackages = let linuxPkgs = super.unstable.linuxPackages_latest; in linuxPkgs.extend (self: super: { # xpadneo = super.xpadneo.overrideAttrs (o: rec { # version = "master"; # src = pkgs.fetchFromGitHub { # owner = "atar-axis"; # repo = "xpadneo"; # rev = "bf8a3c3d7e28162d074744539d0b228566cb0e32"; # sha256 = "0hspmvghr3qi1wf17xwfhd5wy7z1rdzh6qhwlhwgfv21f02n2xs9"; # }; # }); }); }; in { orbekk.gaming.enable = true; orbekk.desktop.enable = true; orbekk.simple-firewall.allowedTCPPorts = [ # pulseaudio 4713 ]; orbekk.simple-firewall.allowedUDPPorts = [ # avahi 5353 ]; environment.systemPackages = with pkgs; [ openmw kodi retroarch wmctrl # for steam launcher openmw ]; nixpkgs.config.kodi = { enableAdvancedLauncher = true; enableAdvancedEmulatorLauncher = true; enableJoystick = true; enableSteamLauncher = true; enableInputStreamAdaptive = true; }; nixpkgs.config.retroarch = { enableCitra = true; enableDolphin = true; }; nixpkgs.overlays = [ my-overlay ]; # hardware.xpadneo.enable = true; systemd.services.xow.wantedBy = ["multi-user.target"]; systemd.services.xow.serviceConfig.Group = "input"; hardware.uinput.enable = true; systemd.packages = [ pkgs.xow ]; services.hardware.xow.enable = true; boot.blacklistedKernelModules = ["mt76x2u"]; # Interferes with xow hardware.pulseaudio = { enable = true; extraModules = [ pkgs.pulseaudio-modules-bt ]; package = lib.mkForce pkgs.pulseaudioFull; # extraConfig = '' # load-module module-dbus-protocol # load-module module-jack-sink channels=2 # load-module module-jack-source channels=1 # ''; systemWide = true; # configFile = pkgs.writeText "default.pa" '' # load-module module-bluetooth-policy # load-module module-bluetooth-discover # ## module fails to load with # ## module-bluez5-device.c: Failed to get device path from module arguments # ## module.c: Failed to load module "module-bluez5-device" (argument: ""): initialization failed. # # load-module module-bluez5-device # # load-module module-bluez5-discover # ''; }; systemd.services.pulseaudio = { # environment."JACK_PROMISCUOUS_SERVER" = "jackaudio"; serviceConfig = { LimitMEMLOCK = "infinity"; }; }; # users.extraUsers.pulse.extraGroups = [ "jackaudio" ]; networking.firewall.allowedTCPPorts = [ 22 4713 ]; networking.networkmanager.enable = true; networking.networkmanager.wifi.powersave = false; networking.vlans = { "enp37s0.admin" = { id = 255; interface = "enp37s0"; }; }; networking.interfaces."enp37s0.admin".useDHCP = true; programs.bcc.enable = true; systemd.extraConfig = "DefaultLimitNOFILE=1048576"; security.pam.loginLimits = [{ domain = "*"; type = "hard"; item = "nofile"; value = "1048576"; }]; systemd.timers.duckdns = { wantedBy = [ "timers.target" ]; timerConfig = { OnBootSec = "1m"; OnUnitInactiveSec = "10m"; }; }; services.blueman.enable = true; hardware.steam-hardware.enable = true; services.xserver.videoDrivers = [ "amdgpu" ]; services.xserver.resolutions = [{x=2560; y=1440;}]; hardware.cpu.amd.updateMicrocode = true; hardware.enableAllFirmware = true; hardware.enableRedistributableFirmware = true; console.font = "ter-i32b"; console.packages = [ pkgs.terminus_font ]; console.earlySetup = true; boot.loader.grub.enable = true; boot.loader.grub.version = 2; boot.loader.grub.device = "nodev"; boot.loader.grub.efiSupport = true; boot.loader.efi.canTouchEfiVariables = true; boot.kernelPackages = pkgs.my-linuxPackages; boot.kernelModules = [ "kvm-amd" "i2c-dev" ]; # https://bugzilla.kernel.org/show_bug.cgi?id=203709 boot.extraModprobeConfig = '' options iwlwifi power_save=0 options iwlwifi swcrypto=1 options iwlwifi disable_11ax=1 options iwlwifi bt_coex_active=0 options iwlmvm power_scheme=1 # options bluetooth disable_ertm=1 # For xpadneo alias hid:b0005g*v0000045Ep000002E0 hid_xpadneo alias hid:b0005g*v0000045Ep000002FD hid_xpadneo alias hid:b0005g*v0000045Ep00000B05 hid_xpadneo alias hid:b0005g*v0000045Ep00000B13 hid_xpadneo ''; systemd.services.monitor-switch-to-me = { description = "Switch monitor to this computer"; path = [ pkgs.ddcutil ]; script = let target = "0x0f"; in '' # Would like to avoid switching if possible; sadly this doesn't reliably # report other input sources. # ddcutil --mfg HPN getvcp 60 | grep sl=${target} || \ ddcutil --mfg HPN setvcp 60 ${target} --sleep-multiplier 4 # Prevent from getting executed multiple times in succession. sleep 15 ''; }; services.udev.extraRules = '' # ACTION!="add", GOTO="display_switch_end" # # Trigger on Planck keyboard. # ATTRS{idVendor}=="feed",\ # ATTRS{idProduct}=="6060",\ # RUN+="${pkgs.systemd}/bin/systemctl start --no-block monitor-switch-to-me.service" # LABEL="display_switch_end" # For xpadneo ACTION=="add", KERNEL=="0005:045E:02FD.*|0005:045E:02E0.*|0005:045E:0B05.*|0005:045E:0B13.*", SUBSYSTEM=="hid", DRIVER!="xpadneo", ATTR{driver/unbind}="%k", ATTR{[drivers/hid:xpadneo]bind}="%k" ACTION=="add", DRIVERS=="xpadneo", SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="1", TAG+="uaccess", MODE="0664", ENV{LIBINPUT_IGNORE_DEVICE}="1" ''; # boot.kernelPackages = let # linux_pkg = { fetchgit, buildLinux, ... } @ args: # buildLinux (args // rec { # version = "5.6"; # modDirVersion = "5.6.0"; # src = pkgs.fetchgit { # url = "https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux.git"; # rev = "v5.6"; # sha256 = "06xddhg04gv9azqikvv98xcv8x6h0x3xy2zc6r7m7jjd28a5bh6j"; # }; # kernelPatches = []; # } // (args.argsOverride or {})); # linux = pkgs.callPackage linux_pkg {}; # in pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor linux); boot.kernelParams = []; networking.hostName = "firelink"; # Define your hostname. system.stateVersion = lib.mkForce "20.03"; # SSD configuration fileSystems."/" = { device = "/dev/mapper/cryptsystem"; fsType = "ext4"; options = ["noatime" "discard"]; }; boot.initrd.luks.devices."cryptsystem".device = "/dev/disk/by-uuid/8acc11c2-e540-4561-8c88-34176fca1a72"; boot.initrd.luks.devices."cryptsystem".allowDiscards = true; fileSystems."/boot" = { device = "/dev/disk/by-uuid/C636-D264"; fsType = "vfat"; }; programs.ssh.askPassword = "${pkgs.x11_ssh_askpass}/libexec/x11-ssh-askpass"; # 60 fps services.xserver.xrandrHeads = let monitor = name: { output = name; monitorConfig = '' ModeLine "3840x2160" 594.00 3840 4016 4104 4400 2160 2168 2178 2250 +hsync +vsync Option "PreferredMode" "3840x2160_60" ''; }; in [ (monitor "HDMI-A-0") (monitor "HDMI-A-1") ]; }