# I packaged Half-Life 2 leaked source code

**URL:** https://discourse.nixos.org/t/i-packaged-half-life-2-leaked-source-code/57877
**Category:** Announcements
**Created:** [December 26, 2024, 1:16am UTC](https://discourse.nixos.org/t/i-packaged-half-life-2-leaked-source-code/57877 "2024-12-26T01:16:30Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![crux](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/c/a6a055/32.png) [@crux](https://discourse.nixos.org/u/crux)
#### Post date: [December 26, 2024, 1:16am UTC](https://discourse.nixos.org/t/i-packaged-half-life-2-leaked-source-code/57877/1 "2024-12-26T01:16:30Z")

</div>

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](https://github.com/nillerusr/source-engine) 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](https://github.com/dot-file/source-engine)

A bit more detailed description [in my PR](https://github.com/nillerusr/source-engine/pull/406).

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

 ![image_2024-12-26_03-42-23](https://discourse.nixos.org/uploads/default/original/3X/e/c/ec7e27291b94eb90d750b6411cb1df1757054a8e.jpeg)

---

<div class="post-metadata">

### Author: ![vcunat](https://discourse.nixos.org/user_avatar/discourse.nixos.org/vcunat/32/11_2.png) [@vcunat](https://discourse.nixos.org/u/vcunat)
#### Post date: [December 26, 2024, 3:15pm UTC](https://discourse.nixos.org/t/i-packaged-half-life-2-leaked-source-code/57877/2 "2024-12-26T15:15:55Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Kranzes](https://discourse.nixos.org/user_avatar/discourse.nixos.org/kranzes/32/7577_2.png) [@Kranzes](https://discourse.nixos.org/u/Kranzes)
#### Post date: [December 26, 2024, 7:02pm UTC](https://discourse.nixos.org/t/i-packaged-half-life-2-leaked-source-code/57877/3 "2024-12-26T19:02:04Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Atemu](https://discourse.nixos.org/user_avatar/discourse.nixos.org/atemu/32/10383_2.png) [@Atemu](https://discourse.nixos.org/u/Atemu)
#### Post date: [December 26, 2024, 7:28pm UTC](https://discourse.nixos.org/t/i-packaged-half-life-2-leaked-source-code/57877/4 "2024-12-26T19:28:36Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Jaculabilis](https://discourse.nixos.org/user_avatar/discourse.nixos.org/jaculabilis/32/3629_2.png) [@Jaculabilis](https://discourse.nixos.org/u/Jaculabilis)
#### Post date: [December 26, 2024, 8:54pm UTC](https://discourse.nixos.org/t/i-packaged-half-life-2-leaked-source-code/57877/5 "2024-12-26T20:54:13Z")

</div>

> [@crux](#):
>
> I’m still very new to Nix so any advice of how to make it better is highly appreciated!

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.

---

<div class="post-metadata">

### Author: ![waffle8946](https://discourse.nixos.org/user_avatar/discourse.nixos.org/waffle8946/32/27221_2.png) [@waffle8946](https://discourse.nixos.org/u/waffle8946)
#### Post date: [December 27, 2024, 1:57am UTC](https://discourse.nixos.org/t/i-packaged-half-life-2-leaked-source-code/57877/6 "2024-12-27T01:57:52Z")

</div>

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

---

<div class="post-metadata">

### Author: ![crux](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/c/a6a055/32.png) [@crux](https://discourse.nixos.org/u/crux)
#### Post date: [December 27, 2024, 2:49am UTC](https://discourse.nixos.org/t/i-packaged-half-life-2-leaked-source-code/57877/7 "2024-12-27T02:49:06Z")

</div>

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 😄. 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!

---

<div class="post-metadata">

### Author: ![Jaculabilis](https://discourse.nixos.org/user_avatar/discourse.nixos.org/jaculabilis/32/3629_2.png) [@Jaculabilis](https://discourse.nixos.org/u/Jaculabilis)
#### Post date: [December 27, 2024, 3:43am UTC](https://discourse.nixos.org/t/i-packaged-half-life-2-leaked-source-code/57877/8 "2024-12-27T03:43:01Z")

</div>

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.

> [@crux](#):
>
> 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.

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?

---

<div class="post-metadata">

### Author: ![crux](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/c/a6a055/32.png) [@crux](https://discourse.nixos.org/u/crux)
#### Post date: [December 27, 2024, 4:19am UTC](https://discourse.nixos.org/t/i-packaged-half-life-2-leaked-source-code/57877/9 "2024-12-27T04:19:22Z")

</div>

> [@Jaculabilis](#):
>
> I don’t think I could package stuff three months into using Nix

Don’t worry, you’ll get there!

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

> [@Jaculabilis](#):
>
> `symlinkJoin`

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

---

<div class="post-metadata">

### Author: ![uep](https://discourse.nixos.org/user_avatar/discourse.nixos.org/uep/32/5167_2.png) [@uep](https://discourse.nixos.org/u/uep)
#### Post date: [December 31, 2024, 5:54am UTC](https://discourse.nixos.org/t/i-packaged-half-life-2-leaked-source-code/57877/10 "2024-12-31T05:54:31Z")

</div>


