diff --git a/modules/steamdeck/sdgyrodsu.nix b/modules/steamdeck/sdgyrodsu.nix index 8274a605..5ac8ab07 100644 --- a/modules/steamdeck/sdgyrodsu.nix +++ b/modules/steamdeck/sdgyrodsu.nix @@ -24,23 +24,15 @@ in }; }; config = mkIf cfg.enableGyroDsuService { - systemd.services.sdgyrodsu = { + systemd.user.services.sdgyrodsu = { description = "Cemuhook DSU server for the Steam Deck Gyroscope"; - wantedBy = [ "multi-user.target" ]; - path = [ pkgs.usbutils ]; + wantedBy = [ "default.target" ]; serviceConfig = { - DynamicUser = true; - SupplementaryGroups = [ "input" ]; ExecStart = "${pkgs.sdgyrodsu}/bin/sdgyrodsu"; PrivateTmp = true; ProtectSystem = "strict"; ProtectHome = true; }; }; - - services.udev.extraRules = '' - # This rule is needed to expose the hiddev devices to sdgyrodsu - SUBSYSTEM=="usbmisc", ATTRS{idVendor}=="28de", MODE="0660", GROUP="input" - ''; }; } diff --git a/pkgs/sdgyrodsu/default.nix b/pkgs/sdgyrodsu/default.nix index 310b33d5..6c894785 100644 --- a/pkgs/sdgyrodsu/default.nix +++ b/pkgs/sdgyrodsu/default.nix @@ -1,19 +1,19 @@ -{ lib, stdenv, fetchFromGitHub, ncurses }: +{ lib, stdenv, fetchFromGitHub, ncurses, hidapi, systemd }: -stdenv.mkDerivation { +stdenv.mkDerivation(finalAttrs: { pname = "sdgyrodsu"; - version = "unstable-2022-08-22"; + version = "2.0"; src = fetchFromGitHub { owner = "kmicki"; repo = "SteamDeckGyroDSU"; - rev = "6244cbc3ec55687efa9b6ade32d6c04637065003"; - sha256 = "sha256-3hMSgFqNV9GyShwU0aB3tEpx82SUBHGl9jpYDYDua8k="; + rev = "v${finalAttrs.version}"; + sha256 = "sha256-bYaqT2fznIQ8UPKUBQZFLB02XuVx3zDeX7XtsBAZfWk="; }; - buildInputs = [ ncurses ]; + buildInputs = [ ncurses hidapi systemd ]; - makeFlags = [ "NOPREPARE=1" "release" ]; + makeFlags = [ "NOPREPARE=1" "CHECKDEPS=" "release" ]; installPhase = '' runHook preInstall @@ -29,4 +29,4 @@ stdenv.mkDerivation { homepage = "https://github.com/kmicki/SteamDeckGyroDSU"; license = licenses.mit; }; -} +})