my-development-setup-2024.txt

Article

My Development Setup 2024

I’ve been a Mac user for essentially my entire life. I wouldn’t describe myself as a “fanboy” or a loyalist to the brand; I’ve just always found macOS to be more intuitive and complementary to how I work. However, over the past few years, Linux has gradually captured my attention, leading me to purchase a 14-inch ThinkPad X1 Carbon laptop in late 2023 with the aim of transitioning to Linux as my primary development environment by mid-2024.

While setting up my Linux laptop, I thought it would be a good opportunity to go over the tools I am using for 2024 to develop web and CLI applications as I install them.

The goal is to keep my new machine lean and focused. Once I have Nix configured to my liking, I’ll then transition my 2019 15” MacBook Pro from Homebrew to Nix as a package manager (it’s cross-platform).

Before diving in, I’ll preface this post by stating that I spend all my programming time in the terminal, so don’t be alarmed if you don’t see my VSCode settings :).

Terminal Setup

The terminal gets its own section, since I spend the vast majority of my time using it. My configurations for each of the core tools I use are shown as their respective sections from my home.nix file.

Emulator: Alacritty

I’m pretty quick to try a new terminal emulator as they hit the scene, but I always end up sticking with Alacritty. It’s fast, simple and minimalist, which serves my purposes well. WezTerm is an intriguing side shell however, Alacritty prioritizes performance above all else, but it’s fun to use an application that isn’t afraid to try new things.

programs.alacritty = {
  enable = true;
  settings = {
    shell = {
      program = "fish";
      args = [ "--login" ];
    };
    font = {
      normal = {
        family = "BlexMono Nerd Font";
        style = "Regular";
      };
      bold = {
        family = "BlexMono Nerd Font";
        style = "Bold";
      };
      italic = {
        family = "BlexMono Nerd Font";
        style = "Italic";
      };
      bold_italic = {
        family = "BlexMono Nerd Font";
        style = "Bold Italic";
      };
      size = 16;
    };
  };
};

Shell: Fish

I installed Starship to give my prompt a little extra pizzaz. I do use NuShell from time to time, it’s approach intrigues me and I could see it being useful for some specific use cases.

programs.fish = {
  enable = true;
  interactiveShellInit = ''
    starship init fish | source
  '';
  shellAliases = {
    zj = "zellij";
    lg = "lazygit";
    ll = "eza -l --icons --header";
    lla = "eza -l -a --icons --header";
  };
};

Multiplexer: Zellij

I’ve fully defected from tmux to Zellij. The maintainer has been keeping a strong pace with new features and improvements they just added persistent sessions and a plugin system. I like the defaults a lot, and it’s also easy to customize.

programs.zellij = {
  enable = true;
  settings = {
    default_layout = "compact";
    default_shell = "fish";
    theme = "catpupuccin-mocha";
  };
};

Tools

  • NeoVim as my IDE
  • LazyGit is amazing tool, I haven’t needed a Git GUI in years
  • GitHub CLI CLI for managing GitHub repos
  • GitLab CLI GitLab’s official CLI
  • eza as a replacement for ls
  • bat a better version of cat
  • ripgrep + fzf for searching all my stuff

Applications

Aside from the obvious collection of browsers I use for testing, these are a few programs I used for the odd times I don’t use a terminal

  • Arc Browser I didn’t expect to enjoy this fresh take on the modern web browser, but I use it as my main Mac browser, but I also use Firefox on Nix for my browsing.
  • Things Another Mac-only app that I’m looking to replace with a cross-platform alternative, but as far as task list apps go, it has been my favourite.
  • 1password It took me a while to come around to the their new business model, but I have found the new developer tooling to be quite useful.
  • Docker
  • Pixen All the pixel art on my site was made with Pixen, though again, I’ll be looking towards a cross-platform alternative like LibreSprite in the near future.

Conclusion

I love reading development setup articles, I always find at least a tool or 2 worth checking out. My hope is this overview helps pay that forward to any other developers that happen to stumble upon it! If you have any questions, feel free to email me.

737 Words

Published

Why I Choose Nix

Selecting a Linux distribution can be a daunting task due to the sheer volume of options, but after a couple blogs and YouTube videos I was pretty much sold on NixOS. From a developer’s perspective I really like how it handles package management and isolation. For example, I recently was working on a Node 18 project that used PM2, neither of which I had installed on my machine.

$ node -v
which: no node in (...)
$ which pm2
which: np pm2 in (...)

Traditionally there are a few options here:

  1. Install Node with a package manager like Homebrew, a version manager like nvm, then PM2 $ npm i -g pm2, or
  2. Install and setup a Docker container with the pinned Node version

With Nix you get to side-step these choices and use built in features of the OS that easily solve the problem for you. A recent audit I was conducting for a client needed Node 18 to run the development server. All I had to do was write this simple shell.nix config file:

{ pkgs ? import <nixpkgs> { } }:
pkgs.mkShell {
  packages = with pkgs;[
    nodejs_18
    pm2
  ];
}

Run these commands:

$ nix-shell
[nix-shell:~/Projects/node-18-app]$ node -v
v18.17.1
[nix-shell:~/Projects/node-18-app]$ which pm2
/nix/store/{hash}-pm2-5.3.0/bin/pm2
$ pm2 start

And now I have the exact server environment needed to run this project locally. Nix pulls and caches the binaries locally, and they are only made available if you either start up an interactive shell like above, or add them to my system config. I really like that there’s no additional applications, YAML files and processes to reckon about, developing uses the same knowledge I’ve been applying to my entire system.

I can definitely understand if this whole approach is a bit off-putting, but if you’re used to a configuration system like NeoVim it doesn’t long to buy into this system, and I’m looking forward to customizing it to run on multiple machines, and eventually servers.