-
Notifications
You must be signed in to change notification settings - Fork 24
/
flake.nix
135 lines (112 loc) · 3.29 KB
/
flake.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
{
description = "C# GUI application for manipulation of RSI files used in SS14.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-22.11";
};
outputs = { self, nixpkgs }: {
packages.x86_64-linux.rsiedit = nixpkgs.legacyPackages.x86_64-linux.callPackage (
{ lib
, buildDotnetModule
, fetchFromGitHub
, dotnetCorePackages
, libX11
, libICE
, libSM
, libXi
, libXcursor
, libXext
, libXrandr
, fontconfig
, glew
, makeDesktopItem
, copyDesktopItems
, wrapGAppsHook
, gtk3
, pango
, cairo
, atk
, zlib
, glib
, gdk-pixbuf
}:
let
version = "0.2.5";
pname = "rsiedit";
in buildDotnetModule rec {
inherit pname;
inherit version;
# Yes, this is entirely redundant but I don't trust submodules...
# And also I don't trust anyone to actually maintain this flake lmao
src = fetchFromGitHub {
owner = "space-wizards";
repo = "RSIEdit";
rev = "v${version}";
hash = "sha256-oHX764t58e4jcGjjgd9ncIbyWjZi3ZqlencsnxOTfDo=";
fetchSubmodules = true;
};
dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-runtime = dotnetCorePackages.sdk_6_0;
nugetDeps = ./deps.nix; # File generated with `nix run .#fetch-deps`
buildType = "Release";
selfContainedBuild = false;
projectFile = [
"Editor/Editor.csproj"
];
nativeBuildInputs = [ wrapGAppsHook copyDesktopItems ];
buildInputs = [ gtk3 ];
dontWrapGApps = true;
preFixup = ''
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
runtimeDeps = [
# Avalonia UI dependencies.
libX11
libICE
libSM
libXi
libXcursor
libXext
libXrandr
fontconfig
glew
# Needed for file dialogs.
gtk3
pango
cairo
atk
zlib
glib
gdk-pixbuf
];
executables = [ "Editor" ];
desktopItems = [
(makeDesktopItem {
name = pname;
exec = meta.mainProgram;
desktopName = "RSIEdit";
comment = meta.description;
categories = [ "Graphics" ];
startupWMClass = meta.mainProgram;
})
];
meta = with lib; {
description = "C# GUI application for manipulation of RSI files used in SS14.";
homepage = "https://github.com/space-wizards/RSIEdit";
license = licenses.mit;
platforms = [ "x86_64-linux" ];
mainProgram = "Editor";
};
}) { };
packages.x86_64-linux.fetch-deps = self.packages.x86_64-linux.rsiedit.passthru.fetch-deps;
packages.x86_64-linux.default = self.packages.x86_64-linux.rsiedit;
apps.x86_64-linux.rsiedit = {
type = "app";
program = "${self.packages.x86_64-linux.rsiedit}/bin/Editor";
};
apps.x86_64-linux.fetch-deps = {
type = "app";
program = "${self.packages.x86_64-linux.fetch-deps}";
};
apps.x86_64-linux.default = self.apps.x86_64-linux.rsiedit;
};
}