I have been using NixOS as my daily driver Linux distro for a couple of years now. The biggest downside I have run into is the available amateur radio packages are lacking. I’ve been learning how to package stuff slowly, and have been using (or making) flatpaks or docker containers for some of the other software I need.

NixOS’s declarative configuration and immutable nature make it the perfect OS for systems that just have to work, like packet nodes for instance. One of the major roadblocks that had been preventing me from migrating my BPQ systems to NixOS I managed to solve today, and that is the lack of AX.25 support in the NixOS kernel.

Most documentation on adding kernel modules revolves around proprietary video or network drivers, or other out-of-tree drivers. None of this helps us with this missing in-kernel support. After an embarrassingly long time searching, I decided to check out the kernel section of the NixOS wiki and the answer was right in front of me. To build the modules, add the following configuration to your hardware-configuration.nix:

  boot.kernelPatches = [ {
    name = "ax25-config";
    patch = null;
    extraConfig = ''
      HAMRADIO y
      AX25 m
      AX25_DAMA_SLAVE y
      NETROM m
      ROSE m
      MKISS m
      6PACK m
      BPQETHER m
      BAYCOM_SER_FDX m
      BAYCOM_SER_HDX m
      YAM m
    '';
  } ];

This configuration adds all the available AX.25 related options as modules that can be loaded later. The downside of this setup is you will need to recompile your kernel from source each time it updates. This is a tradeoff I am more than willing to make.

You will probably want to load some of these modules automatically at boot time. Simply add the modules you want to boot.kernelModules in your /etc/nixos/hardware-configuration.nix. An example from one of my systems is below.

{
    boot.kernelModules = [ "kvm-amd" "ax25" "mkiss" ];
};

In order to take advantage of this module, you will also likely want ax25tools and ax25utils. To add them, simply add the following to the packages section of configuration.nix:

environment.systemPackages = with pkgs; [
    ax25-apps
    ax25-tools
 ];