Add support for all default systems

This commit is contained in:
user 2024-12-26 16:34:19 +03:00
parent e3ee174b53
commit 06f9229623
2 changed files with 76 additions and 39 deletions

34
flake.lock generated
View File

@ -1,5 +1,23 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"ivp-submodule": {
"flake": false,
"locked": {
@ -49,12 +67,28 @@
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"ivp-submodule": "ivp-submodule",
"lib-submodule": "lib-submodule",
"nixpkgs": "nixpkgs",
"thirdparty-submodule": "thirdparty-submodule"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"thirdparty-submodule": {
"flake": false,
"locked": {

View File

@ -1,6 +1,7 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
ivp-submodule = {
url = "github:nillerusr/source-physics";
@ -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
];
};
}
);
}