Jon Sangster’s Blog
Hello, world! My name is Jon Sangster (résumé) and welcome to my personal blog. This website is where I write about software development and Linux tips n’ tricks.
This entire site is literally generated from my notes, so don’t expect a well-polished experience. I plan for it to be less “medium.com influencer” and more “my first Geocities homepage.”
2. Recent Updates
I Published my Emacs Config
I published the org-mode version of my Emacs config to GitHub: sangster/emacs.
I think it may be a right-of-passage for all Emacs converts to put their config online. Over the years, I’ve found a lot of great snippets from the config files of others, and now it’s time to pay it forward! My config is incredibly personalised, so I doubt you’ll find it useful to use it wholesale, but there may be a few good bits and pieces that you can pick out of there.
Nix: Using symlinkJoin with nodePackages
NixOS’s <nixpkgs> repository comes with a handy function for combining different packages (derivations) into a single, large derivations: symlinkJoin. It replicates the directory structure of a list of derivations, creating symlinks to the original files each source derivation. Unfortunately, as we’ll discuss in this post, it chokes badly if you try to join an NPM package into your derivation.
Signing Git Commits on the Terminal
Signing your git commits with GPG works perfectly fine, until that fateful day when you need to commit some code in a non-X11 session. Most likely, you’ll encounter this when you’ve brought your laptop on the road, and need to SSH into your dev-machine at home and commit a few quick changes. Unfortunately for you, after entering your well-formatted commit message, git blocks for about 30 seconds then spits out the following error:
error: gpg failed to sign the data fatal: failed to write commit object
Ruby: Implicit Conversion
Implicit conversion doesn’t come up very often in ruby. It’s a duck-typed language, so as long as an object has the right instance methods defined, everything should be fine. Sometimes though, when you’re dealing with system libraries or linking with other languages, ruby really does need a way to convert your objects into fundamental types, like strings, hashes, and arrays.
A Nix Merge Request
Most everyone I talk to about computers and software want things that “Just work!” The older I get, the more sympathetic I am to this view. There just isn’t enough time in the day to be futzing around with broken things; however, when it comes to my personal computers, I tend to run in the opposite direction. I just love to tinker, and my PCs provide the perfect playground for that. Whenever I find that they “Just work,” why, that’s perfect time to break them with some new project! As a consequence, these days I find myself running the unstable branch of NixOS.
One of the neat things about running on the unstable branch of an new-ish distro is that I often get to see bugs pop up before too many other people. When I used to run a very popular distro, like Arch Linux, solving a bug was mostly a matter of tracking down the forum post containing its fix. With so many nerds on the case, all the fun bugs are fixed before I’ve even finished my work day. With NixOS, if your system configuration is… unique enough, you could easily bump into a bug a day or two before anyone else does.
Earlier this week I ran into such a bug. When doing a system upgrade, I encountered an error for a package that I’m somewhat familiar with, and the error looked pretty easy, so why not take a shot at fixing it?
Final Fantasy 1–6 Pixel Remasters
Like many millennials, I grew up loving Final Fantasy. My family didn’t own any of them, sadly, so I would play the earlier editions whenever I could during visits with our extended family who did. In `98, I hauled-ass, mowing lawns and painting fences all summer, to save up to buy a Playstation 1 and Final Fantasy 7. Worth it!
Recently, SquareEnix (Squeenix?) released new versions of the first six games, known as “pixel remasters.” They rebuilt each game on the same Unity-based engine, with new sprites, updated music, and modern particle effects. Moreover, they’ve added a few quality-of-life features that make certain aspects of the game less tedious.
I feel that they’ve done a great job modernising these classic games and recreating the feeling I had when I first played them as a kid. The Pixel Remasters are certainly now my favourite editions of the first 6 games.
Every Nix flake implicitly gets nixpkgs as an input, but what if it contains a show-stopping bug? It may have been fixed upstream, but these fixes can sometimes take days or weeks to even reach the nixos-unstable branch.
In this article, we’ll describe way one easy way to create a nix.flake that patches nixpkgs.
Shell Scripts with Nix
The goal of this page is to explore and document “best practises” for writing shell scripts and packaging them for the Nix package manager.
- This article describes software which is both: unstable, and something I’m still learning about. As a consequence, this advice may change over time.
Red Dead Redemption 2
I played Red Dead Redemption 1 on the PS3, back in 2011, and absolutely loved it. Well, Red Dead Redemption 2 (RDR2) was released a few years ago now, but this time I decided to wait for its PC release. I never did wind up buying a PS4 and rumours online are that RDR2 runs pretty well on Linux, via Proton, so why not?