forked from Frost-Phoenix/nixos-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrider.nix
60 lines (54 loc) · 1.72 KB
/
rider.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{ pkgs, lib, inputs, ... }: with lib;
let
extra-path = with pkgs; [
dotnetCorePackages.sdk_7_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
dotnet-sdk_7
];
# 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";
};
}