From 13e01134f629ad8ee9e2afb527563bbff98e21a8 Mon Sep 17 00:00:00 2001 From: Jimbo Date: Tue, 27 Aug 2024 14:08:39 -0400 Subject: [PATCH] Add personalized Half-Life nix-derivation --- home-manager/jimbo_desktop.nix | 1 + home-manager/misc/xash3d.nix | 6 ++++++ pkgs/xash/change-zip-date.patch | 17 +++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 home-manager/misc/xash3d.nix create mode 100644 pkgs/xash/change-zip-date.patch diff --git a/home-manager/jimbo_desktop.nix b/home-manager/jimbo_desktop.nix index 43878cb..c12392e 100644 --- a/home-manager/jimbo_desktop.nix +++ b/home-manager/jimbo_desktop.nix @@ -24,6 +24,7 @@ ./misc/filemanager.nix ./misc/production.nix ./misc/gaming.nix + ./misc/xash3d.nix #./misc/emulators.nix #./misc/remotedesktop.nix ./misc/school.nix diff --git a/home-manager/misc/xash3d.nix b/home-manager/misc/xash3d.nix new file mode 100644 index 0000000..714944c --- /dev/null +++ b/home-manager/misc/xash3d.nix @@ -0,0 +1,6 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + xash3d + hlsdk + ]; +} diff --git a/pkgs/xash/change-zip-date.patch b/pkgs/xash/change-zip-date.patch new file mode 100644 index 0000000..d907a52 --- /dev/null +++ b/pkgs/xash/change-zip-date.patch @@ -0,0 +1,17 @@ +diff --git a/scripts/waifulib/zip.py b/scripts/waifulib/zip.py +index 6e903ba7..d47f1754 100644 +--- a/scripts/waifulib/zip.py ++++ b/scripts/waifulib/zip.py +@@ -25,7 +25,11 @@ class ziparchive(Task.Task): + arcfile = src.path_from(self.relative_to) + + Logs.debug('%s: %s <- %s as %s', self.__class__.__name__, outfile, infile, arcfile) +- zf.write(infile, arcfile) ++ ++ arcfile = zipfile.ZipInfo(filename=arcfile, date_time=(1980, 1, 1, 0, 0, 0)) ++ ++ with open(infile, 'rb') as f: ++ zf.writestr(arcfile, f.read()) + + @TaskGen.feature('zip') + def create_zip_archive(self): \ No newline at end of file