forked from nillerusr/source-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.nix
46 lines (39 loc) · 960 Bytes
/
build.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
{ callPackage
, symlinkJoin
, fetchurl
, makeDesktopItem
, copyDesktopItems
, hl2-unwrapped ? callPackage ./hl2-unwrapped.nix { }
, hl2-wrapper ? callPackage ./hl2-wrapper.nix { inherit hl2-unwrapped; }
}:
let
name = "hl2";
icon = fetchurl {
url = "https://upload.wikimedia.org/wikipedia/commons/1/14/Half-Life_2_Logo.svg";
hash = "sha256-/4GlYVAUSZiK7eLjM/HymcGphk5s2uCPOQuB1XOstuI=";
};
in
symlinkJoin rec{
inherit name;
paths = [
hl2-unwrapped
hl2-wrapper
] ++ desktopItems;
nativeBuildInputs = [
copyDesktopItems
];
postBuild = ''
ln -s $out/bin/hl2-wrapper $out/bin/${name}
install -Dm444 ${icon} $out/share/icons/hicolor/scalable/apps/${name}.svg
'';
desktopItems = [
(makeDesktopItem {
name = "${name}";
exec = "${name}";
icon = "${name}";
desktopName = "Half-Life 2";
comment = "Built from the leaked source code";
categories = [ "Game" ];
})
];
}