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": { "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": { "ivp-submodule": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -49,12 +67,28 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"ivp-submodule": "ivp-submodule", "ivp-submodule": "ivp-submodule",
"lib-submodule": "lib-submodule", "lib-submodule": "lib-submodule",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"thirdparty-submodule": "thirdparty-submodule" "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": { "thirdparty-submodule": {
"flake": false, "flake": false,
"locked": { "locked": {

View File

@ -1,6 +1,7 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs"; nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
ivp-submodule = { ivp-submodule = {
url = "github:nillerusr/source-physics"; url = "github:nillerusr/source-physics";
@ -18,45 +19,47 @@
}; };
}; };
outputs = { self, nixpkgs, ... }@inputs: outputs = { self, nixpkgs, flake-utils, ... }@inputs:
let flake-utils.lib.eachDefaultSystem (system:
pkgs = nixpkgs.legacyPackages.x86_64-linux; let
pkgs = import nixpkgs { inherit system; };
# Fix for git submodules # Fix for git submodules
hl2-unwrapped = (pkgs.callPackage ./hl2-unwrapped.nix { }).overrideAttrs { hl2-unwrapped = (pkgs.callPackage ./hl2-unwrapped.nix { }).overrideAttrs {
postPatch = '' postPatch = ''
rm -rf ./{ivp,lib,thirdparty} rm -rf ./{ivp,lib,thirdparty}
ln -s ${inputs.ivp-submodule} ./ivp ln -s ${inputs.ivp-submodule} ./ivp
ln -s ${inputs.lib-submodule} ./lib ln -s ${inputs.lib-submodule} ./lib
ln -s ${inputs.thirdparty-submodule} ./thirdparty ln -s ${inputs.thirdparty-submodule} ./thirdparty
''; '';
}; };
in in
{ {
# Install the game on your own computer # Install the game on your own computer
packages.x86_64-linux = { packages = {
hl2 = pkgs.callPackage ./build.nix { inherit hl2-unwrapped; }; hl2 = pkgs.callPackage ./build.nix { inherit hl2-unwrapped; };
default = self.packages.x86_64-linux.hl2; default = self.packages.${system}.hl2;
}; };
# Build the game for others # Build the game for others
devShells.default = pkgs.mkShell rec { devShells.default = pkgs.mkShell rec {
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
makeWrapper makeWrapper
SDL2 SDL2
freetype freetype
fontconfig fontconfig
zlib zlib
bzip2 bzip2
libjpeg libjpeg
libpng libpng
curl curl
openal openal
libopus libopus
pkg-config pkg-config
gcc gcc
python3 python3
]; ];
}; };
}; }
);
} }