Hacktoberfest 2020 report
Tags: hacktoberfest, perl, nix, mojolicious
Published: 2020-11-13 09:41:19

FPBP!

So, I'm rather new here at dev.to and since Hacktoberfest 2020 has come and gone, I might as well get started doing a new blog here.  I've been doing Hacktoberfests for maybe a couple of years now, and while this year has seen [quite the kerfuffle](https://joel.net/how-one-guy-ruined-hacktoberfest2020-drama), that alone should not be enough reason to stop doing it.

### Background

I work primarily with #perl stuff with bits of #docker and other tools in between, so most of my previous Hacktoberfests have focused on contributing to these.  For this year though, I wanted to learn and use #nix some more, especially as I found the idea of [reproducible developer environments](https://nixos.org/guides/declarative-and-reproducible-developer-environments.html) across different machines to be interesting, and I've tried doing similar things (to mixed results) with Docker.

To help both Nix and Perl efforts, I thought learning enough of Nixpkgs to port missing CPAN modules I want or need would be a good idea to start...

### Contributions

The Hacktoberfest game approved these PRs:
{% github https://github.com/spwhitt/nix-zsh-completions/pull/37 %}

This got me started as I'm using zsh as my default shell, but the Nix tooling uses bash.  Having become an avid user of `nix-shell`, I used the `--dry-run` flag (which it passes down to `nix-store --realise`) for estimating download sizes of stuff I want in the shell.  Since this particular flag was missing in the completion, it seemed easy enough to add it in with this PR, despite some other note about changing the implementation entirely for the new `nix` command interface.

{% github https://github.com/NixOS/nixpkgs/pull/100652 %}

At my work, we're using [Future::AsyncAwait](https://metacpan.org/pod/Future::AsyncAwait) heavily, so I missed this somewhat in Nixpkgs enough to get me started learning how to port it from CPAN to Nixpkgs.  Porting is somewhat easy to do using [nix-generate-from-cpan](https://github.com/NixOS/nixpkgs/blob/master/maintainers/scripts/nix-generate-from-cpan.pl), but the other half of work is testing if it actually builds using `nix-build` to make additional changes if needed, and testing builds of other packages depending on it with [nixpkgs-review](https://github.com/Mic92/nixpkgs-review) preferably on both Nix-enhanced Linux installs as well as on native NixOS and macOS.

Thanks to [stigtsp](https://github.com/stigtsp) for showing me the ropes!

{% github https://github.com/NixOS/nixpkgs/pull/100820 %}

Pretty much anything external that one can substantially reach with [IO::Async](https://metacpan.org/pod/IO::Async) needs TLS/SSL, so missing this in Nixpkgs seems odd.  Adding it here seems a no-brainer, and would help in upcoming packages like `Net::Async::HTTP` and `Net::Async::WebSocket` (with the latter having pretty much a hard dependency for IO::Async::SSL anyway for working on anything non-trivial.)

{% github https://github.com/mojolicious/mojo/pull/1579 %}

This was a PR derived from an earlier more substantial work which was merged later, beyond the Hacktoberfest cutoff:

{% github https://github.com/mojolicious/mojo/pull/1578 %}

I also made a few followup PRs to Nixpkgs that Hacktoberfest counted as bonus:

{% github https://github.com/NixOS/nixpkgs/pull/101118 %}

{% github https://github.com/NixOS/nixpkgs/pull/101182 %}

{% github https://github.com/NixOS/nixpkgs/pull/101402 %}

There's also a few other PRs that didn't make the count, like the one for Mojo above, and these:

{% github https://github.com/mojolicious/mojolicious.org/pull/22 %}

This change is now live at both https://mojolicious.org and https://docs.mojolicious.org (though still keeping an eye on the highlightjs stuff, should they need more updating.)

{% github https://github.com/guibou/nixGL/pull/64 %}

This one came about as I was looking to replace KDE4 Konsole on my Slackware 14.2 with a more modern terminal, and tried both [Alacritty](https://github.com/alacritty/alacritty) and [Kitty](https://sw.kovidgoyal.net/kitty).  I eventually went with Kitty, but since this requires GPU acceleration I needed nixGL and Nixpkgs' own mesa_drivers as well.

{% github https://github.com/docker-library/docs/pull/1822 %}

This was a somewhat longstanding documentation issue on docker-perl (which I maintain for sometime now,) and since it was flaring up on and off again, might as well make the time to document this issue so people using the docker-perl image know what to expect.

### Progress

I was able to do a good many more PRs this year than in previous years, but at the same time many of them weren't eligible for this time due to the changes in the Hacktoberfest game that supposedly ruined it for everyone.  OTOH, I never really actively sought for the reward(s), but rather the experience of this yearly adventure to do a bit more for Free and Open Source Software than what I usually do regularly.

Another thing that tempers my expectation for rewards is that I'd have to go waiting a few more months to receive it, _and_ go through post office procedures which take a good hour or two to complete, which in this pandemic clown world would be a risk I'd rather not take...

### Reflections

Learning Nix and Nixpkgs through porting Perl modules to it was a great experience, and I hope to continue doing so beyond Hacktoberfest.  I'm particularly interested in making a reproducible Perl development environment more easier to do in Nix, maybe with some insight with sister languages like Ruby [Bundix](https://github.com/nix-community/bundix) or Python [pynixify](https://github.com/cript0nauta/pynixify).

I'll also be continuing some [docker-perl](https://github.com/Perl/docker-perl) work, especially as frameworks like Mojolicious are keen to get onto the _cloud-native_ bandwagon (if not so already) in order to do easy, reproducible app deployments to Docker or Kubernetes; Nix may help yet again with that too, as it already has the tooling for exporting to Docker or OCI image formats.