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. ...

Part 5: Nix as Part of Your Development Workflow

My original plan for this article was to discuss my shell and how I configure it. But I have made some significant changes, to how I structure my Nix configuration and I wanted to go over Why I did that. I mean, likely this will probably happen a lot, as my configuration changes more often than it should 🙈. Anyway, into the main topic. My dotfiles Snowfall what? I recently ported my Nix configuration (dotfiles), to use the snowfall-lib to structure my Nix config. ...

Part 4b Foot Terminal as Part of Your Development Workflow

Earlier this year I spoke about using Wezterm as my terminal of choice, however since then, I have swapped back to the foot terminal emulator. I also have kitty available on my system. However, I don’t use it much. In this article, I want to add a quick addendum to why I moved away from Wezterm. Note as per that post, this is again not a super important decision, almost any full colour supported terminal will basically like every other. ...

TIL: How to Fix Neorg Metadata Treesitter Issues With Nixvim

TIL: How to Fix Neorg Metadata Tree Sitter Issues With NixVim If you are like me, you may be configuring your Neovim configuration using NixVim. Which is a “framework” making it easier to configure Neovim using mostly Nix configuration. Allowing us to keep most of our config in one language, at least in my case. I started using Neorg to manage my notes and to-do lists in my “second-brain”, but noticed that the metadata part was not being highlighted as I expected. ...

My Favourite Neovim Plugins

In this post, I will go over some of my Neovim plugins I really like that aren’t as well known. So I won’t really be talking about telescope, LSP or nvim-cmp. As most users know about these plugins and use them extensively in their configuration. oil.nvim Link: https://github.com/stevearc/oil.nvim oil.nvim creates a file explorer but as a true vim buffer, so it’s effortless to create new files and folders. We can also move files easily. ...

TIL: How to Set up Layouts in Zellij That Use Direnv and Nix

TIL: How to Set up Layouts in Zellij That Use Direnv and Nix I have been using Zellij for a while now. I tried to set up layouts for one of my personal projects. So that we could have tests and linting running and any other tasks we may want whilst doing development 1. However, I had an issue working out how to call commands that required direnv and nix to set up development environments. ...

TIL: How to Get Sway Notification Center to Play Nice With Waybar

TIL: How to Get swaync to Play Nice With Waybar I added Sway Notification Center as my notification manager and added a small “widget” to my Waybar, so I can see how many notifications I have and silence notifications by clicking on it. However, I found when I opened the swaync sidebar, in my case by right-clicking on the icon. I found that I could not click on anything else on my Waybar like workspaces. ...

TIL: Clean Up Tmux Service When Removed by Home Manager

TIL: Clean Up Tmux Service When Removed by Home Manager Recently I stopped using tmux to try zellij, however I noticed when I removed tmux from my nix config. I was getting the following error, when rebuilding my home-manager config: The user systemd session is degraded: UNIT LOAD ACTIVE SUB DESCRIPTION ● tmux.service loaded failed failed tmux default session (detached) Legend: LOAD → Reflects whether the unit definition was properly loaded. ...

TIL: How to Run Android Emulator Using avd on Hyprland

TIL: How to Run Android Emulator Using avd on Hyprland Recently, I was having issues when trying to run an Android Emulator using Android Studio (avd). When I would try to run an Emulator from the device manager, I would get the following The emulator process for avd xxx has terminated error. Looking deeper into the logs at ~/.local/cache/Google/AndroidStudio2023.1/log/idea.log, I noticed the following: 2024-02-20 12:01:45,859 [ 781674] INFO - Emulator: Pixel 7 Pro API 34 - Android emulator version 33. ...

How to Load Secret Environment Variables in Fish Shell

Often you want to load environment variables that are secrets, and you don’t want them in your shell history. Such as your GitHub Access Token or API Token when making requests with curl. One easy solution is to load environment variables from a file, say an .env file. Now, since I am using fish shell, loading env variables from a file like we do in bash and zsh won’t work, i. ...

 2024-02-28 281 words 2 min

TIL: How to Add New Vim Plugins to nixpkgs Repository

Recently, I wanted to add a Neovim plugin to nixpkgs, so I can then add it to NixVim. I tried following the guide from the docs. However, I kept getting the following errors: nix-shell -p vimPluginsUpdater --run vim-plugins-updater error: … while calling the 'derivationStrict' builtin at /builtin/derivation.nix:9:12: (source not available) … while evaluating derivation 'shell' whose name attribute is located at /nix/store/whhzjfgalghpm34irclh01c0afynmyll-nixpkgs/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:300:7 … while evaluating attribute 'buildInputs' of derivation 'shell' at /nix/store/whhzjfgalghpm34irclh01c0afynmyll-nixpkgs/nixpkgs/pkgs/stdenv/generic/make-derivation. ...

TIL: How to Fix Firefox Rendering Bug in Hyprland

TIL: How to Fix Firefox Rendering Bug in Hyprland Recently, I had an issue with my Ubuntu laptop running Hyprland, when running Firefox it had this ugly border around it. Which looked something like this: You can see a weird border around the browser, and if you try to view some of the context menus, they appear small and difficult to read. Fix As per this Reddit thread 1. There are two fixes, one upgrade to version 0. ...

How to Move Files Between Two Git Repositories and Keep its History

Background Recently, I had to move one of my to-do files from its own repository, todo, to my second-brain repository. So I could better keep track of my ideas, and tasks to be done. However, I realised just copying the file over I would lose all the git history the file had. Strictly speaking, I don’t need the git history of that file, as the most important thing is the current tasks to be completed. ...

 2024-02-11 469 words 3 min

How To Create A Custom NixOS ISO

Introduction In this post, I will show you how you can create a custom NixOS ISO image, using our normal nix configuration as if it another machine/device. Some of you may be wondering why you want to do that vs using the normal ISO. Particular for installing on my machines I would like to have my device setup in one go, rather than previously I would install using the normal ISO, then clone my dot files and build my config again. ...