How to Fix Firefox Rendering Emoji Font (NixOS)

I was some issues with the ways some fonts were rendering in Nix/NixOS machines. It seemed to specifically effect a few apps, mainly Firefox and only certain webpages. Sometimes numbers would render like below: Debugging Steps This occurred off and on over the course of a few weeks. My font setup was primarily done using stylix and a bit of NixOS option config. I noticed this only seemed to happen when the CSS on the page include a font-family like so “monospace” i. ...

TIL: How to Fix PipeWire/WirePlumber Issues on NixOS

TIL: How to Fix PipeWire/WirePlumber Issues on NixOS For the last month or so, the audio on my Desktop was broken in the sense I had to run these three commands to make it work pipewire & wireplumber & pipewire-pulse Now, normally I hibernate my computer, so I didn’t really have to do this more than once or twice. However, it was very annoying either way to remember to know how to do it. ...

My Year in Review 2024

I did one of these last year, and thought why not do another quick year in review. Catch people up with what I’ve been up to. This year was not nearly as transformative as my previous year in terms of changes I made to my workflow. I am still using Nix and NixOS, I am still using Neovim. I moved onto from tmux to zellij mainly because I just like the floating terminal it provides. ...

Part 7: Zellij as Part of Your Development Workflow

After another 5 months I’m finally back blogging about my development setup. Which since my last post, has been a lot more stable. As much closer to a workflow I am mostly happy with. In this post, we will go over how I integrate Zellij. What is a terminal multiplexer? Zellij is a terminal multiplexer think like tmux or screen. It another one of those projects written in rust. Which seems pretty popular for creating similar tools to existing ones but usually faster. ...

Speaking Tips I Have Learnt From Conferences

Since 2022 I have tried to speak at least one conference/meetup a year. The main reason for this was it forces to really learn the area I want to present about a lot deeper. If you can explain something new to someone clearly then it really shows you understand it very well. Recently, I was lucky enough to speak at GoLabs 2024 in Florence, which was a load of fun and a week later at the London Gophers November Meet. ...

How to Wrap NixGL Around Package in Home Manager

I use Nix mainly with home manager on my Ubuntu laptop, and for the most part, it works fine. However, some apps installed using Nix, need to use nixGL. A wrapper tool for OpenGL, allowing Nix installed tooling to use the system’s OpenGL and Vulkan APIs. Some apps including kitty and Firefox (mainly for Google Meet). There is currently a branch in home-manager we can pull into our config, which provides a convenient way to wrap these apps in nixGL rather than needing to specify say nixGLIntel kitty in our terminal or say Hyprland config (key bindings). ...

How to Set up Cloudflare Tunnels With Traefik (In NixOS)

Recently, I was setting up Navidrome, kind of like a self-hosted Spotify, in my home lab and I wanted to set it up to use proxy auth in Authentik. But to do this I needed to use with a reverse proxy, i.e. Traefik. In this article I will show you how to you can point your Cloudflare tunnel to Traefik and have that forward the request to the service. Prerequisite In this article, I assume you are already familiar with Cloudflare Tunnels and Traefik. ...

TIL: How to Cancel Stale Pipelines in GitLab CI

TIL: How to Cancel Stale Pipelines in GitLab CI Today I learnt that we can cancel old pipelines in MRs. For example, you push a new commit, and you don’t care about the old pipeline running any more. You want to cancel them to save CI minutes etc. Here is an example, you can see the 2nd pipeline is cancelled: We need to add this to our .gitlab-ci.yml file. Where the default. ...

TIL: How to Get Shell Completions in Nix Shell With Direnv

TIL: How to Get Shell Completions in Nix Shell With Direnv When shell completions don’t work with direnv, you may need to use nix develop to load the shell manually. Background I am using nix-direnv, with nix devshell to autoload into my development environments. I changed the directory and the devshell is automagically loaded without me doing anything, which is great. Provides me with a bunch of tools specific for that project. ...

How to Set up Authentik Forward Auth With Traefik on NixOS

In this post, I will show you how you can set up forward auth for a single host in Authentik, with Traefik as our reverse proxy on NixOS. This is particularly useful way to protect apps that don’t have any built in auth. Authentik is a great app which can handle authentication for almost all of our home lab. So we only need to log in with Authentik, to log in to any of our apps. ...

Setup TLS Certificate With Traefik & Tailscale on NixOS

Recently I have been playing around with running a homelab directly on a NixOS machine without kubernetes. I didn’t want to bother to have to setup certificates using Traefik (DNS challenge) and Cloudflare. I wanted to use the certificate that comes with Tailscale (wireguard VPN I use to connect to my home lab). In this post I will show you how I set this up as a Nix module. Nix Let us look at the relevant Nix code. ...

How to Configure Kitty on Nix to Show Emojis

Recently, I was trying to configure the terminal emulator Kitty with Nix and Stylix, and I was having issues with it showing emojis. It took me a lot longer to figure out than I would like to admit. So I decided to write a blog post, showing you how I did it and perhaps saving you some time. I did this in my home-manger config. First we install the Symbols Nerd Font, there are two ways we can normally add nerd fonts. ...

How I Set up BTRFS and LUKS on NixOS Using Disko

In this post, I will show you how you can declaratively partition our drives using Nix(OS). TL;DR; We can use a tool called disko to partition our drives declaratively and combine it with NixOS anywhere for a remote install. Showing an example setting up LUKS encryption with BTRFS file system. Background If you’re like me, then when you started playing with NixOS, You found yourself constantly reinstalling it and starting again. ...

How I Configured Zellij Status Bar

As some of you may know, I moved to Zellij a few months ago from tmux. In this post, I will show you have I configured the zellij status bar in nix. So it acts more like how my config did in tmux. My current Zellij status bar. (Optional) Background A bit of background, which you can skip if you’d like. What is zellij? Some of you may be wondering what is zellij/tmux. ...

Part 6: Fish Shell as Part of Your Development Workflow

After a long break, I am again writing about my workflow. The big issue I have with this series is that my workflow is kind of always in flux and changing. Which maybe is a bad thing. I just need to pick some tools and stick to it. Rather than trying four different terminal emulators, i.e. alacritty, kitty, foot and wezterm. However, over the last ~5ish years, one thing that has remained pretty constant is my use of fish shell. ...

Rewriting a Python script as a Bash one-liner

In this post, I will describe how I went about replacing a Python with a bash liner and how it decreased the runtime from 30 seconds to 1 second Background For this blog, I used to have a Python script which I would use to generate open graph images. These are images you sometimes see in apps when you share a link. For example: Essentially, what it would do is go through every post in my blog repository. ...

Migrating My Homelab to Flux

Background This series is a continuation of the other series. I have since updated my home lab, removing the RPIs and replacing them with some mini pcs. As part of this change I am now using deploy-rs instead of colmena. As its easier to integrate into my own flake, and it won’t roll out the change if breaks the networking, i.e. you cannot ssh to the machine. Why move away from Pulumi? ...

TIL: How to Fix Did No Resolve Alias Errors in Podman

TIL: How to Fix Did No Resolve Alias Errors in Podman Recently, I was trying to pull docker images using podman, on an Ubuntu laptop and was getting an error which looked something like: Error: error creating build container: short-name "node:18.17" did not resolve to an alias and no unqualified-search registries are defined in "/etc/containers/registries.conf" This is because Podman doesn’t allow us to use short names, by default we need to specify the registry i. ...

TIL: How to Fix DNS Resolution Issues in K3s Related to Flannel Networking

TIL: How to Fix DNS Resolution Issues in K3s Related to Flannel Networking Recently, I was trying to set up the kubernetes-dashboard, to make it easier to monitor my k8s cluster. I however noticed I was getting the following error: … > add-kubernetes-dashboard via 🐹 v1.22.2 via  via ❄ impure (nix-shell-env) k$ kubectl logs -n monitoring kubernetes-dashboard-kong-75bb76dd5f-b27ll 2024/05/05 20:55:21 [error] 1319#0: *274054 [lua] init.lua:371: execute(): DNS resolution failed: failed to receive reply from UDP server 10. ...

How I Fixed Hibernate on My NixOS Machine

tl:dr; Wi-Fi drivers were stopping the PC from suspending. I am using an Ethernet cable to connect my PC. So didn’t need the Wi-Fi drivers. By adding them to a blocklist. I think you only need the 2nd one in the list. { boot.blacklistedKernelModules = [ "ath12k_pci" "ath12k" ]; } Recently, I upgraded my PC to an am5 machine with an X670E Gigabyte motherboard. However, when I did this hibernate was left broken, alongside suspend. ...

How to Add reveal-hugo to a Hugo Site

What we are trying to achieve hosting RevealJS slides on our Hugo blog like so. The markdown that the slides are built from It can be found here Background Recently, I did a talk at the Conf42 conference shameless plug here. At the time I was working on the slides using Reveal.js, as I did for all of my slides as I can create a slideshow using just plain markdown. I hosted all of my talks in a separate repository. ...

How to Deploy Kubernetes Dashboard Using Pulumi to a K3s Cluster

Kubernetes Knowledge I don’t know a ton about Kubernetes. I am still learning, hence this home-lab project. So there may be better ways to do stuff that I have described below. If that is the case, please let me know! Just take what I say with a pinch of salt. It’s been a while since I made an update about my home lab, also an aside, I should’ve given this series a better name. ...

How to Use Env Variables With Viper Config Library in Go

This is part of a series of where I am going to blog about issues I had building my CLI tool OptiNix and documenting how I resolved those issues. Most will be random things not specifically related to building CLI tools. In this example, we will use the viper library. Mainly because I am already using cobra, the library to help us make CLI tools. From the same author and wanted to see how well they integrated. ...

TIL: How to Pull Submodules in a Nix Derivation

TIL: How to Pull Submodules in a Nix Derivation Recently, I was trying to create a derivation which needed to pull git submodules as well. I was getting an error which look something like this: data/meson.build:76:0: ERROR: Nonexistent build file 'data/submodules/meson.build' It was coming from this derivation https://gitlab.com/hmajid2301/dotfiles/-/blob/c153de146a3bf9339cbef013ac65bc32e6305c8e/packages/gradience/default.nix for building the latest version of gradience. It turns out when we do a fetchFromGitHub we need to explicitly tell it to also pull submodules, which makes sense. ...

 2024-05-12 142 words 1 min

Part 5B: Installing Our Nix Configuration (NixOS Anywhere) as Part of Your Workflow

I wanted to do a short article showing you how you can use your Nix config to install NixOS on a new device. Have your device setup with NixOS in a few commands with all the packages and tooling you want. Previously I was creating my own ISO and then burning that to a USB and using that USB as live media to install my config. I had a custom script nix_installer, which would run automatically when you loaded into the gnome shell. ...