diff --git a/nixos/gui/default.nix b/nixos/gui/default.nix index befda04..65d256a 100644 --- a/nixos/gui/default.nix +++ b/nixos/gui/default.nix @@ -3,8 +3,8 @@ let cfg = config.jconfig.gui; in { - config = lib.mkIf (config.jconfig.enable && cfg.enable) - { + config = lib.mkMerge [ + (lib.mkIf (config.jconfig.enable && cfg.enable) { environment.systemPackages = [ pkgs.gnome.adwaita-icon-theme pkgs.adwaita-qt @@ -56,22 +56,24 @@ in hardware.opengl.enable = true; hardware.uinput.enable = true; hardware.steam-hardware.enable = cfg.steamHardwareSupport; - } // lib.mkIf cfg."8bitdoFix" { - # Udev rules to start or stop systemd service when controller is connected or disconnected - services.udev.extraRules = '' - # May vary depending on your controller model, find product id using 'lsusb' - SUBSYSTEM=="usb", ATTR{idVendor}=="2dc8", ATTR{idProduct}=="3106", ATTR{manufacturer}=="8BitDo", RUN+="${pkgs.systemd}/bin/systemctl start 8bitdo-ultimate-xinput@2dc8:3106" - # This device (2dc8:3016) is "connected" when the above device disconnects - SUBSYSTEM=="usb", ATTR{idVendor}=="2dc8", ATTR{idProduct}=="3016", ATTR{manufacturer}=="8BitDo", RUN+="${pkgs.systemd}/bin/systemctl stop 8bitdo-ultimate-xinput@2dc8:3106" - ''; + }) + (lib.mkIf cfg."8bitdoFix" { + # Udev rules to start or stop systemd service when controller is connected or disconnected + services.udev.extraRules = '' + # May vary depending on your controller model, find product id using 'lsusb' + SUBSYSTEM=="usb", ATTR{idVendor}=="2dc8", ATTR{idProduct}=="3106", ATTR{manufacturer}=="8BitDo", RUN+="${pkgs.systemd}/bin/systemctl start 8bitdo-ultimate-xinput@2dc8:3106" + # This device (2dc8:3016) is "connected" when the above device disconnects + SUBSYSTEM=="usb", ATTR{idVendor}=="2dc8", ATTR{idProduct}=="3016", ATTR{manufacturer}=="8BitDo", RUN+="${pkgs.systemd}/bin/systemctl stop 8bitdo-ultimate-xinput@2dc8:3106" + ''; - # Systemd service which starts xboxdrv in xbox360 mode - systemd.services."8bitdo-ultimate-xinput@" = { - unitConfig.Description = "8BitDo Ultimate Controller XInput mode xboxdrv daemon"; - serviceConfig = { - Type = "simple"; - ExecStart = "${pkgs.xboxdrv}/bin/xboxdrv --mimic-xpad --silent --type xbox360 --device-by-id %I --force-feedback"; + # Systemd service which starts xboxdrv in xbox360 mode + systemd.services."8bitdo-ultimate-xinput@" = { + unitConfig.Description = "8BitDo Ultimate Controller XInput mode xboxdrv daemon"; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.xboxdrv}/bin/xboxdrv --mimic-xpad --silent --type xbox360 --device-by-id %I --force-feedback"; + }; }; - }; - }; + }) + ]; }