forked from nillerusr/source-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
65 lines (59 loc) · 1.5 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
ivp-submodule = {
url = "github:nillerusr/source-physics";
flake = false;
};
lib-submodule = {
url = "github:nillerusr/source-engine-libs";
flake = false;
};
thirdparty-submodule = {
url = "github:nillerusr/source-thirdparty";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
# Fix for git submodules
hl2-unwrapped = (pkgs.callPackage ./hl2-unwrapped.nix { }).overrideAttrs {
postPatch = ''
rm -rf ./{ivp,lib,thirdparty}
ln -s ${inputs.ivp-submodule} ./ivp
ln -s ${inputs.lib-submodule} ./lib
ln -s ${inputs.thirdparty-submodule} ./thirdparty
'';
};
in
{
# Install the game on your own computer
packages = {
hl2 = pkgs.callPackage ./build.nix { inherit hl2-unwrapped; };
default = self.packages.${system}.hl2;
};
# Build the game for others
devShells.default = pkgs.mkShell rec {
nativeBuildInputs = with pkgs; [
makeWrapper
SDL2
freetype
fontconfig
zlib
bzip2
libjpeg
libpng
curl
openal
libopus
pkg-config
gcc
python3
];
};
}
);
}