Skip to content

Commit

Permalink
Add support for all default systems
Browse files Browse the repository at this point in the history
  • Loading branch information
adivinaelnombre committed Dec 26, 2024
1 parent e3ee174 commit 06f9229
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 39 deletions.
34 changes: 34 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

81 changes: 42 additions & 39 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";

ivp-submodule = {
url = "github:nillerusr/source-physics";
Expand All @@ -18,45 +19,47 @@
};
};

outputs = { self, nixpkgs, ... }@inputs:
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
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.x86_64-linux = {
hl2 = pkgs.callPackage ./build.nix { inherit hl2-unwrapped; };
default = self.packages.x86_64-linux.hl2;
};
# 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
];
};
};
# 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
];
};
}
);
}

0 comments on commit 06f9229

Please sign in to comment.