Contributing to nixpkgs for the first time

Published on February 9, 2025

I’ve been using NixOS for a couple years now but only in the last month have I had the opportunity to contribute something back. In this case it’s the packaging code for Hoarder, a bookmarking app I’ve been using the last couple of months as a Pocket replacement.

Although I’m not a regular contributor to any open source project, contributing to Nixpkgs has been, by far, the least daunting. I think a big reason is contributing doesn’t require much special knowledge for people that are already using Nixpkgs. While maintaining my Nix laptop, Nix server (which runs this website) and Nix Homelab I’m writing Nix code regularly and often have to create my own derivations, or modify other derivations. This includes using the Nixpkgs standard library and, sometimes, digging into certain internal things.

Read More

Nix for Advanced Beginners: The Nix Store

Published on January 26, 2025

Nix sometimes gets a reputation for being confusing. In this article I’m trying to articulate certain ideas that, once I understood them, made Nix much easier to understand.

Nix is a bunch of technologies and projects that build on top of each other

If you google for source code of nix you get the NixOS/nix repository on Github which dubs itself the purely functional package manager. This becomes confusing as you get deeper into Nix.

Read More

Opening a shell connected to wireguard, but not the rest of your system (Linux)

Published on October 6, 2024

Problem: you’re trying to access a blocked website and want to curl something so the request goes over a VPN. Sometimes you can solve this with --proxy variants but let’s say that’s not an option. Maybe you’re using software other than curl. What you’re looking for is a shell that any command you run, even software not aware of proxies or VPNs, gets routed over the VPN.

This is surprisingly easy to do, but requires some prior know-how.

Read More

Nix: Where are my neovim plugins?

Published on February 24, 2024

I was recently trying to figure my home manager setup and wasn’t sure why a plugin wasn’t working.

The neovim part of this configuration looks something like this,

programs.neovim = {
    enable = true;
    plugins = with pkgs.vimPlugins; [
      nvim-solarized-lua
      editorconfig-vim
      vim-airline
      nvim-treesitter.withAllGrammars
    ];
    extraLuaConfig = ''
      vim.opt.ai = true
      vim.opt.encoding = 'utf8'
      vim.opt.expandtab = true
      vim.opt.swapfile = false
      vim.opt.number = true
      vim.opt.shiftwidth = 4
    '';
  };

Before things broke, this worked auto-magically for me and I didn’t think about it much. The plugins probably just exist in my neovim configuration, right?

Read More

Managing servers with NixOS: a gitea instance

Published on February 19, 2024

I recently moved all my servers to NixOS1, which lets these machines be configured using code. The configuration for these servers is stored in a single git repository in a gitea instance managed by one of the servers. I’m going through the configuration for one of these machines in this post.

The base of this configuration is flake.nix,

{
  description = "Nix servers configurations";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
    home-manager.url = "github:nix-community/home-manager/release-23.11";
  };

  outputs = { self, nixpkgs, home-manager }: {
    nixosConfigurations = {
      mothership = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          ./shared.nix
          ./mothership.nix
        ];
      };
      /* ... other machine configurations ... */
    };
  };
}

When I was first starting out with Nix, I found everything here a bit complicated but it’s simple (-ish) when you break it down.

Read More

A more minimal theme

Published on December 5, 2023

I started this blog on Jekyll, and used the Jekyll Now theme by default. When I switched to Hugo I ported this theme. At the time I really liked the Jekyll now theme, and still do. But I also feel like it’s getting in the way of the content, and I want to focus on other things.

On desktop this means you’re probably hitting ctrl + to zoom in on the content, but I think the content is clearer to read once you do. Mobile seems to size things better by default.

Read More

GPT Intern: Infinite Loop

Published on June 10, 2023

Using GPT is like having a hardworking, if slow, intern that’s good at Googling things.

Earlier today I was trying to write a simple Flask echo server – I’m not familiar with Flask – to echo a query string back at the user. I spent a comparable amount of time on my GPT prompt as I would have searching Google and I got back this nice piece of code,

from flask import Flask, request

app = Flask(__name__)

@app.route('/')
def echo():
    query = request.args.get('q', '')
    return query

if __name__ == '__main__':
    app.run()

Pretty good!1 Except I specifically asked it to make sure the content-type is text/plain. Upon testing, it seems Flask returns text/html in this case.

Read More

Investigating Backup Solutions: Tarsnap vs. Restic and B2

Published on January 4, 2023

In my previous post I talked about the various changes I’ve made to my home server, among which was the ongoing switch from Tarsnap to Restic+B2 for backups. I’ve decided as part of this effort to evaluate both solutions in more detail, and I’m going to record the results of that research here. I’m going to be doing some rough tests to determine how fast, efficient (with regards to compression and deduplication), and how easy to use each solution is.

Read More

Setting up a Home Server with Fedora

Published on December 27, 2022

For a while now I’ve had a home server made from the remains of an old gaming PC after I sold the GPU. It sits in the corner generating heat, and running some non-essential services like a Gitea server, backing up my Dropbox files somewhere else1, and serving some static video files that I watch on my Xbox with Kodi. I traditionally have run Debian, but I’ve started to branch out and have started experimented with the Fedora distributions. I’m going to talk about the switch to Fedora 37, some of the pros of that switch (Fedora has been better suited to my needs), but also about my setup in general.

Read More

Notes on Learning Rust

Published on November 14, 2022

I’ve recently been learning Rust and I just finished finished The Rust Programming Language. While I went through this I supplemented the many questions I had with other resources like The Rustonomicon and various Google searches. It’s mostly these detours I want to write about.

Read More

More posts...