feat: Fix improved-crosshairs and allow customisation of alternatives
This commit is contained in:
@@ -41,6 +41,8 @@ in lib.mergeAttrsList [
|
||||
{ mastercomfig = callPackage ./mastercomfig.nix {}; }
|
||||
{ huds = callPackage ./huds {}; }
|
||||
{ maps = callPackage ./maps {}; }
|
||||
(callPackage ./misc.nix {})
|
||||
(builtins.mapAttrs
|
||||
(_: v: callPackage v {})
|
||||
(import ./misc {inherit lib;}))
|
||||
(callPackage ./scripts.nix {})
|
||||
]
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
{ fetchFromGameBanana, mkTf2Config, ... }:
|
||||
|
||||
{
|
||||
improved-crosshairs = mkTf2Config {
|
||||
pname = "improved-crosshairs";
|
||||
custom = [
|
||||
(fetchFromGameBanana {
|
||||
name = "improved-crosshairs";
|
||||
id = "1047153";
|
||||
hash = "sha256-ULcSfxuiGY1YCE1zQ693183F7ZRC11tYhvDMJKyzL1A=";
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
10
tf2/packages/misc/default.nix
Normal file
10
tf2/packages/misc/default.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ lib, ... }:
|
||||
|
||||
lib.mapAttrs'
|
||||
(file: _:
|
||||
lib.nameValuePair
|
||||
(lib.removeSuffix ".nix" file)
|
||||
(import ./${file}))
|
||||
(lib.filterAttrs
|
||||
(file: _: lib.hasSuffix ".nix" file && file != "default.nix")
|
||||
(builtins.readDir ./.))
|
||||
34
tf2/packages/misc/improved-crosshairs.nix
Normal file
34
tf2/packages/misc/improved-crosshairs.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{ fetchFromGameBanana
|
||||
, stdenv
|
||||
, lib
|
||||
# Alternate crosshairs to use. See their README.
|
||||
, alternates ? []
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "improved-crosshairs";
|
||||
version = "2.0";
|
||||
src = fetchFromGameBanana {
|
||||
name = "improved-crosshairs";
|
||||
id = "1047153";
|
||||
hash = "sha256-ULcSfxuiGY1YCE1zQ693183F7ZRC11tYhvDMJKyzL1A=";
|
||||
};
|
||||
buildPhase = ''
|
||||
${lib.toShellVar "alternates" alternates}
|
||||
dest_dir="Crosshairs/materials/vgui/replay/thumbnails/"
|
||||
for alt in "''${alternates[@]}"; do
|
||||
dest="$dest_dir/$(sed -e 's/\(.*\) \[.*\]$/\1/' <<< "$alt").vtf"
|
||||
src="Alternates/$alt.vtf"
|
||||
if [ ! -e "$src" ]; then
|
||||
echo "Alternate '$alt' does not exist!"
|
||||
exit 1
|
||||
else
|
||||
mv "$src" "$dest"
|
||||
fi
|
||||
done
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out/custom
|
||||
mv Crosshairs "$out/custom/improved-crosshairs"
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user