diff --git a/modules/home/default.nix b/modules/home/default.nix index 1ab1a93..9daad82 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -13,6 +13,7 @@ ++ [(import ./aseprite)] ++ [(import ./audacious)] ++ [(import ./unity)] + ++ [(import ./rider)] # ++ [(import ./discord)] ++ [(import ./swaylock)] ++ [(import ./wofi)] diff --git a/modules/home/rider/default.nix b/modules/home/rider/default.nix new file mode 100644 index 0000000..fd808df --- /dev/null +++ b/modules/home/rider/default.nix @@ -0,0 +1,59 @@ +{ pkgs, lib, inputs, ... }: with lib; +let + + extra-path = with pkgs; [ + dotnetCorePackages.sdk_6_0 + dotnetPackages.Nuget + mono + msbuild + ]; + + extra-lib = with pkgs;[ + # Personal development stuff + xorg.libX11 + + # Rider Unity debugging + xorg.libXcursor + xorg.libXrandr + libglvnd + ]; + + _rider = pkgs.jetbrains.rider.overrideAttrs (attrs: { + postInstall = '' + # Wrap rider with extra tools and libraries + mv $out/bin/rider $out/bin/.rider-toolless + makeWrapper $out/bin/.rider-toolless $out/bin/rider \ + --argv0 rider \ + --prefix PATH : "${lib.makeBinPath extra-path}" \ + --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath extra-lib}" + + # Making Unity Rider plugin work! + # The plugin expects the binary to be at /rider/bin/rider, with bundled files at /rider/ + # It does this by going up one directory from the directory the binary is in + # We have rider binary at $out/bin/rider, so we need to link /rider/ to $out/ + shopt -s extglob + ln -s $out/rider/!(bin) $out/ + shopt -u extglob + '' + attrs.postInstall or ""; + }); +in +{ + home.packages = with pkgs; [ + _rider + ]; + + # Unity Rider plugin looks here for a .desktop file, + # which it uses to find the path to the rider binary. + home.file = { ".local/share/applications/jetbrains-rider.desktop".source = + let desktopFile = pkgs.makeDesktopItem { + name = "jetbrains-rider"; + desktopName = "Rider"; + exec = "\"${rider}/bin/rider\""; + icon = "rider"; + type = "Application"; + # Don't show desktop icon in search or run launcher + extraConfig.NoDisplay = "true"; + }; + in "${desktopFile}/share/applications/jetbrains-rider.desktop"; + }; +} \ No newline at end of file