I packaged Half-Life 2 leaked source code

Put hl2/ and platform/ folders from Half-Life 2 in ~/hl2 and run nix run github:dot-file/source-engine (then take a nap as it compiles)

The maintainer of the original repo seems to have abandoned it so here’s my fork: GitHub - dot-file/source-engine: Modified source engine (2017) developed by valve and leaked in 2020. Not for commercial purporses

A bit more detailed description in my PR.

I’m still very new to Nix so any advice of how to make it better is highly appreciated!

7 Likes

I’m sorry, just couldn’t help with a nit note:

Source code is based on TF2 2018 leak. Don’t use it for commercial purposes.

If the source code was leaked, i.e. you don’t have any kind of permission from the copyright holder, you’re not allowed to use it at all (for any purposes). Just saying. The risk is probably low in this case anyway.

6 Likes

I just realized the code on GitHub is up for many years with over a thousand stars and over 250 forks. I really don’t think anyone cares anymore.

1 Like

It may also be the case that they’ve already sued 2 people over this already in which case you’d be absolutely fine.

/s

1 Like

This is pretty impressive for someone new to Nix! Do you mind elaborating a little on the experience of accomplishing something like this as a newcomer? I think most Nix users are aware that it has a rough learning curve, but once one has picked it up, it can be hard to remember what it was like not knowing how to do anything.

Feels weird to advertise clearly illegal content on an official forum for the Nix(OS) community.

Thanks! Well first of all I should clarify what I mean by “still very new to Nix”. I’ve been using NixOS and tinkering with it really hard for three months already. So I’m pretty experienced with using NixOS. However I still know quite little about Nix itself. I’ve done two thirds of Nix Pills so that helps but I still feel like I can’t really get a grasp on all the mechanics under the hood.

So it actually took me a week to make this package! It seemed very transparent at first but then I had issues at every small step (how to package waf script, how to generate .desktop, how to combine the executable and the wrapper properly etc.) and spent hours solving them. Lack of straightforward documentation didn’t help either - I had to learn many things from reading the source code of functions and looking up examples of their usage in nixpkgs repo. So all in all it was very difficult, I literally felt the same way as when I installed NixOS for the first time :smile:. But it was absolutely worth the effort because the whole process is very creative and because what I did is fully reproducible. Contributing to the community is so freaking fulfilling!

2 Likes

I don’t think I could package stuff three months into using Nix, so you’re ahead of me there. I never sat down and did the Pills, despite advice from my betters, which probably explains why.

Are you talking about stuff like the available parameters for mkDerivation or symlinkJoin, or stuff like the utility functions in lib, or the mechanics of how overrideAttrs works?

1 Like

Don’t worry, you’ll get there!

Nix pills are quite difficult indeed… I actually gave up the first time I tried it :grin:

This, along with copyDesktopItems and something else I don’t remember