Posted on May 12, 2026 Tags: nix , forge action , auto update First Automation Attempt Naive Commit Selection Smarter Commit Selection Manual Run Links Possible Improvement Upstreaming I maintain the SelfHostBlocks project. It relies on nixos/nixpkgs/unstable as its sole dependency and it attempts to follow the latest commit as close as possible. If you’re wondering why, it’s because I like the…
Posted on May 1, 2026 Tags: nix , emacs 1. Setup Emacs 2. Setup nix config 3. Configure secret Misc Clear auth-sources cache Self-hosted Bitwarden Log into vault Unlock vault Sync vault From Magit, it is possible to create pull requests. Of course, we need to setup a secret token to be able to create a pull request on the forge. One way is to store the secret in a file read by emacs. By default,…
Posted on June 1, 2025 Tags: qemu , nix Nix CDROM (sr0) Iso file in Nix EFI SATA (sdX) drive NVMe (nvmeX) drive Qemu’s documentation is a bit scattered around the web. I managed to follow the nvme documentation but just couldn’t find anything in qemu.org about SATA drives apart from some small snippets in other sections. Some other examples could be found on StackOverflow. This blog post regroups…
Posted on March 23, 2025 Tags: nix , server Scaffolding Generate a SSH keypair Configuration for the Server Host Configuration for the Client Host Cleanup Conclusion Let’s see how to grant ourselves ssh access form a client host to a server host using NixOS. This post assumes you can already deploy to the server host, by means of another ssh key. So this is not about bootstrapping a server. Here,…
Posted on March 10, 2025 Tags: nix Hibernation was broken for me since a long time. I postponed trying to fix it for such a long time. Then, I stumbled onto this post which had the fix! To celebrate the finding, I’m sharing a NixOS module to enable hibernation. As a prerequisite, you need to create a swap partition, as noted in the NixOS wiki . As for the module, here it is: { config , pkgs , lib…
Posted on March 1, 2025 Tags: jellyfin The goal is to create a user in Jellyfin that can only see media files that have a given tag, say “kids”, and that tag was set inside Radarr, Sonarr or another *arr application. *arr Configuration Within Settings > Metadata > Kodi, check “Enable” and “Movie Metadata”. Then, when adding or editing a movie, add a tag to mark media that children can watch, like…
Posted on November 28, 2024 Tags: nix Why Skipping this Step is a Good Idea Why Does Host Key Verification Exist Pre-Seed the Host Key This post goes over how to create a new server and be able to ssh into it without needing to go through the ssh host verification manual step. This step is annoying, error prone and tedious enough that I’m sure most of us answer “yes” to the question as fast as…
Posted on September 3, 2024 Tags: nix , nextcloud , systemd , iot , server So I wanted to show family pictures on the TV. My current setup is: a server using NixOS to host Nextcloud , an OrangePi 3 with Libreelec and Kodi , and mobile phones with the iOS Nextcloud app. What I wanted is to be able to select, from Nextcloud, which pictures to show on the TV and those would appear there…
Posted on August 7, 2024 Tags: nix Context Starting Small Going Deeper Analyzing Store Size Analyzing Store Size Some More Let’s step back Context So you want to cleanup the Nix store. I wanted too. This led me down a medium sized rabbit whole. Read this post to follow it too! You might learn a couple things. I realized my disk was close to full. 74Gb available from a 1Tb SAD. Time to clean up the…
Posted on July 10, 2024 Tags: git , performance It’s no secret that the nixpkgs repo is quite big. Big enough to slow down git operations to noticeable lags. I use Emacs and Magit and with those, loading the status page takes - I kid you not - 15 seconds. Now, I don’t mind waiting a couple seconds, but here it’s just over my patience threshold. I must say, the conclusion will be obvious in…
Posted on July 8, 2024 Tags: go , testing Context Integration Tests Where Mocks Fail Where Stubs Shine Conclusion Context In a previous post, I wrote about how using stateful property testing helped us find test cases that were hard to find by hand. This helped us complete a project in a timely fashion. But some other surprising benefits came from introducing stateful property testing. To switch…
Posted on July 3, 2024 Tags: nix Context Flake Input Give the Inputs to the NixOS Configuration NixOS with nixos-rebuild Darwin NixOS with colmena Common Config In Practice Context So I have this repository for my Emacs config. How can I make NixOS aware of it and copy the files in the correct location? Flake Input First step, putting the repo as a Nix flake input: { inputs = { nixpkgs . url =…
Posted on June 13, 2024 Tags: nix Context Potential Harmful Change Impossible to Recover Did not Test Bonus Stress Inducing Factor Recovery Overview NixOS Recovery USB stick nixos-enter flake Update Configuration nixos-rebuild Unmount Cleanly Takeaway Context I managed to brick my NixOS server. The recipe to achieve that is quite simple, just throw all best practices out the window by doing the…
Posted on May 24, 2024 Tags: nix When evaluating a nix expression, sometimes you get a failure. But then, on next evaluation, you get this error message: $ nix build .#checks.x86_64-linux.modules error: cached failure of attribute 'checks.x86_64-linux.modules' The failure got cached! How do you see the error message again? By adding --option eval-cache false : $ nix build…
Posted on April 15, 2024 Tags: nix After a while without removing old generations, I got into a pickle. Situation After running colmena apply to deploy to my server for the Nth time, I got this error: Activation failed: Child process exited with error code: 1 [ERROR] stderr ) OSError: [Errno 28] No space left on device: '/nix/store/cwimj1bg0dgfvngdmbrapkp5ifl3bfgy-initrd-linux-6.6.22/initrd' - >…
Posted on March 22, 2024 Tags: jellyfin , iot Libreelec is a Linux distribution optimized to run Kodi . I installed it on an Orange Pi 3 LTS which is connected to my TV. I then installed the Jellyfin plugin and can play all my media from Jellyfin on the TV. To boost performance, I installed the distribution on the internal flash eMMC storage instead of keeping it on the SD card. This blog post…
Posted on February 27, 2024 Tags: go , testing Our Initial Problem - A Driver Migration Business Logic Led To Combinatory Explosion When Testing Property Testing Stateful Property Testing Stateful Property Testing to Tame The Combinatory Explosion Great Success (Part 2 of this blog post is posted here ) In this blog post, I’ll explain what problem I tried to solve by introducing stateful property…
Posted on February 23, 2024 Tags: nix , nextcloud I want Digikam to access Nextcloud storage using WebDav. But Digikam needs this folder to be actually mounted on the filesystem, so the setup implies some fiddling. Internet Search Here are all the interesting links that helped me figure out how this should work. From the Digikam manual : Collections on Network Shares: these are root album folders…
Posted on February 9, 2024 Tags: nix , zfs I resisted long enough. Having bought two new hard drives, I had a good enough reason to switch over from LVM + mdadm. This blog post is as much a memo for myself than a terse guide to people wanting to try ZFS. Partitioning From https://openzfs.github.io/openzfs-docs/Project%20and%20Community/FAQ.html#performance-considerations Create your pool using…
Posted on December 25, 2023 Tags: nix , ci This is pretty cool. Thanks to two GitHub workflows, I managed to automate updating the flake.lock of my project . Every day at midnight, the first workflow will run, try to update the flake.lock file and if there’s an update, it will create a Pull Request with the automerge label. The second workflow runs every time a Pull Request gets updated (opened,…
Posted on December 11, 2023 Tags: nextcloud , postgresql , performance My Nextcloud instance feels… sluggish, for lack of better term. It’s working, but it definitely feels slow. Pages take seconds to load. Let’s continue our previous investigation of Nextcloud slowness and try to fix this. I will warn you, not all investigations did lead to an optimization, most were dead ends. But I think the…
Posted on December 3, 2023 Tags: nix By default, you use the root user to deploy to a target machine. If you want to avoid that, you can create another user but getting all the configuration right is not obvious. So here’s a rundown in 3 steps. 1. Create User First, you need to create the user and make it able to run sudo without requiring a password. Let’s pick the username nixos . The hammer way…
Posted on December 3, 2023 Tags: nix After running a nix build command and getting an error, the output usually prompts you to run nix log like so: For full logs, run 'nix log /nix/store/iyp0l0h9ik0zkmmg8ryxmb8y15a32apz-self-host-blocks-manual.drv' This is great but a bit heavy on copy/pasting. Also, if you update your code and build again, the hash will change as expected but that requires you to…
Posted on December 2, 2023 Tags: nix , blog Motivation I wanted to use flakes to build this blog since quite a while but never got to it. The last nudge needed was I was fed up with the current deploy process which involved a second repository (see a previous blog post for more details). It was really hindering my motivation to write blog posts. I wanted instead to deploy by just pushing to the…
Posted on November 26, 2023 Tags: nix edit 2024-06-15: fix snippet Following the trail from discourse to a closed GitHub pull request to a comment in a second GitHub pull request :) I’m happy to share that we can now easily apply patches to nixpkgs itself. This is pretty neat because now, if you want to apply an open pull request immediately to your project, you can easily do it. Well, the code is…
Posted on November 8, 2023 Tags: nix The Incentive section explains why I even wanted to do this. Feel free to skip to the second paragraph . Incentive Switching From Nixos-Rebuild to Colmena Incentive I’ve been deploying to my two server boxes with Colmena since a few months now and I’m very happy. My laptop is using NixOS and I’ve been “deploying” to it using nixos-rebuild switch since the…
Posted on October 26, 2023 Tags: The Issue Prerequisite The CLI Way to Migrate Data The Web UI Way to Migrate Data Conclusion The Issue When setting up Nextcloud for the first time, I created some users. Everything was fine. But then, I wanted to integrate with LLDAP to manage the users through a LDAP server. The issue arose from the fact that the user created from Nextcloud is not the same as the…
Posted on August 12, 2023 Tags: nextcloud , performance Accessing Nextcloud’s web UI, using http, seems reasonably fast but accessing the webdav interface is painfully slow. Like, it doesn’t even seem to work at all slow. What’s up with that? Let’s embark in a journey on how to profile Nextcloud. Did anyone stumbled onto this issue already? Searching for slow Nextcloud webdav brought up this post…
Posted on July 2, 2023 Tags: nix , server This post will show one way to backup Home Assistant automatically. I’ll use Nix to set things up but I will also show the resulting configuration files so you can follow along even if you do not use Nix. The idea is to have home assistant itself create a backup using an automation that is scheduled to run on a regular basis. Then, you can use whatever…
Posted on June 25, 2023 Tags: grafana I had this problem where in grafana I wanted to show the increase of a gauge or counter over time. I didn’t want to show the absolute value, but the increase. There is no builtin function to handle showing increases where a time serie possibly has null values and drops, like for example after a deploy where it starts from 0. So here are the steps to achieve…
Posted on May 15, 2023 Tags: server , nix This blog post recaps how to install NixOS with only a WiFi connection, how to manage the WiFi connection declaratively and how to encrypt the passphrase during deploy. This is only really useful for a machine that will not move much. If you’re trying to configure WiFi on a laptop, I would recommend using services.networkmanager and configure the…
Posted on May 12, 2023 Tags: server , nix I am writing this blog post because, although all the documentation is available online, it is not always obvious how all the parts should fit together. Install NixOS Aside on WiFi Activate the System Manually Configure SSH Public Key Access Remove SSH Password Access Deploy to the Raspberry PI with Colmena Conclusion Install NixOS Follow the Official…
Posted on May 9, 2023 Tags: emacs , hakyll With the following snippet, I can call M-x hakyll-blog-new-post , fill in the title and get started writing right away. (defgroup hakyll-blog nil "Hakyll Blog." :group 'applications ) (defcustom hakyll-blog-dir "~/blog" "Hakyll blog directory." :type 'string :group 'hakyll-blog ) (defcustom hakyll-blog-file-time-format "%Y-%m-%d" "Hakyll blog post…
Posted on May 8, 2023 Tags: emacs I created a custom shortcut Meta-T in KDE with the following trigger: emacsclient -e "(org-capture)" --create-frame I went with calling org-capture directly as that shows a buffer where I can choose which template to use. If I was using the org-protocol feature, I’d need to setup one KDE shortcut per template, the maintenance of which would annoy me to no end, on…
Posted on April 21, 2023 Tags: nix , server Setting Sops is done by following the steps in the README file. But I struggled on step “Get a public key for your target machine”. This is what it tells us to do: nix-shell -p ssh-to-age \ --run 'cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age' But you need to ssh into the machine to get the public key. How to do that? Well, this “little” one liner…
Posted on October 9, 2021 Tags: server Note: since I wrote this blog post, I switched to using NixOS. I’m leaving this post up because it could still hold valuable info. This is obviously the first step, we will install the OS. I chose Archlinux. Everything here should be adaptable to other linux distributions but the locations of files could be different. We’ll create a live USB, use it to…
Posted on October 5, 2021 Tags: server Note: since I wrote this blog post, I switched to using NixOS. I’m leaving this post up because it could still hold valuable info. This is the introductory post in the let’s build a server series. This series goes through all the steps needed to setup the same server I have at home. Along the way, I’ll explain everything I know or thought of while setting up…
Posted on October 22, 2020 Tags: hakyll Let’s add some tags to each blog post. The tags are added in the header section of each post. For example: --- title: Deploy the Blog to GitHub Pages tags: hakyll, haskell, nix --- This will produce a blog post with 3 tags. Clicking on a tag will bring you to a page with all blog posts tagged with that tag. You can also access to all tags from a special Tags…
Posted on October 20, 2020 Tags: misc It’s kind of obvious in retrospective, but I try to pay attention when I’m writing something on the internet. For example, sharing my Emacs configuration made me realize I had a few hacks in place and I felt dirty sharing those. I took some time to rework the hacks and that resulted in improving my configuration and making it more maintainable. The same thing…
Posted on October 17, 2020 Tags: hakyll , haskell , nix , emacs , lsp , systemd We need to make Emacs find Haskell executables through Nix. It will use LSP with the Ghcide LSP server as basis to parse the source code, Flycheck for live errors in the buffer and Brittany to format the code. Ghcide and Brittany are installed with Nix . To make all this work, we will use the following Emacs packages:…
Posted on October 16, 2020 Tags: hakyll This is “just” a matter of creating a CSS file and adding it to the repository. The hard part is to have the patience to create the CSS file, at least for me, because the css classes are not descriptive (ex: what the hell are class="ot" and class="op" ?). I tried finding ready to use ones but I could only find some on tejasbubane/hakyll-css . I chose the…
Posted on October 16, 2020 Tags: hakyll , haskell , nix I want to use GitHub Pages because it is a very simple to use static site server and it is readily available when using GitHub. We could try to use GitHub CI to deploy to GitHub Pages but I do not want to deal with this complexity just yet. The method I will use for now is manual and requires two repositories: one that holds the source code…
Posted on October 15, 2020 Tags: hakyll , haskell , nix This blog post explains how to setup this site. You can find the source code on GitHub . We will not publish yet, it will be all local. Publishing is for the following post. The stack we’ll be using is Hakyll on top of Haskell and Nix . I use Emacs as my editor so there will be some later blog posts explaining how to set that up. We will…
Posted on October 15, 2020 Tags: misc I wanted to start writing a blog since a long time. I like sharing my knowledge so it seemed like a good idea. Time will tell! I needed a way to write blog posts and publish them so I searched for a tool that could suite me. There are a few subjects I want to share about but being a programmer, talking about code and sharing code snippets seemed natural. This…