Git submodules fix

This commit is contained in:
user 2024-12-23 06:04:17 +03:00
parent bd140bb156
commit 6850933db7
3 changed files with 81 additions and 8 deletions

View File

@ -1,12 +1,9 @@
{ callPackage
, symlinkJoin
, hl2-unwrapped ? callPackage ./hl2-unwrapped.nix { }
, hl2-wrapper ? callPackage ./hl2-wrapper.nix { inherit hl2-unwrapped; }
}:
let
# Strangely, these are overridable
hl2-unwrapped = callPackage ./hl2-unwrapped.nix { };
hl2-wrapper = callPackage ./hl2-wrapper.nix { inherit hl2-unwrapped; };
in
symlinkJoin {
name = "hl2";

53
flake.lock generated
View File

@ -1,5 +1,37 @@
{
"nodes": {
"ivp-submodule": {
"flake": false,
"locked": {
"lastModified": 1703378318,
"narHash": "sha256-FA5NrzumsKADWmC2JeUiYShHE7LoEWH8E92R5IEana0=",
"owner": "nillerusr",
"repo": "source-physics",
"rev": "47533475e01cbff05fbc3bbe8b4edc485f292cea",
"type": "github"
},
"original": {
"owner": "nillerusr",
"repo": "source-physics",
"type": "github"
}
},
"lib-submodule": {
"flake": false,
"locked": {
"lastModified": 1663437616,
"narHash": "sha256-tpK15gJOvFpjDqFAIQ1lyaCW81R1Sxd39sX2xHsWX3o=",
"owner": "nillerusr",
"repo": "source-engine-libs",
"rev": "86a66ee92d9fda0a09f54a435e850faa7ab5d0fa",
"type": "github"
},
"original": {
"owner": "nillerusr",
"repo": "source-engine-libs",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1734566935,
@ -17,7 +49,26 @@
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
"ivp-submodule": "ivp-submodule",
"lib-submodule": "lib-submodule",
"nixpkgs": "nixpkgs",
"thirdparty-submodule": "thirdparty-submodule"
}
},
"thirdparty-submodule": {
"flake": false,
"locked": {
"lastModified": 1694693388,
"narHash": "sha256-d/vKz9gCwXd2fyxCxU4xE/3hb7A7mCO5AUyAD1vCIuY=",
"owner": "nillerusr",
"repo": "source-thirdparty",
"rev": "3b2f5275072a0acdbac410f14f750b690b9b4c13",
"type": "github"
},
"original": {
"owner": "nillerusr",
"repo": "source-thirdparty",
"type": "github"
}
}
},

View File

@ -1,15 +1,40 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
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 }:
outputs = { self, nixpkgs, ... }@inputs:
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
# 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
{
packages.x86_64-linux = {
hl2 = pkgs.callPackage ./build.nix { };
hl2 = pkgs.callPackage ./build.nix { inherit hl2-unwrapped; };
default = self.packages.x86_64-linux.hl2;
};
};