Creating a base OCI image for Nix flake builds within Gitea/Forgejo

I’ve been moving more and more of my infrastructure to be self-hosted recently. Part of that involves setting up CI jobs for testing and publishing artifacts, mostly rust crates but also this very blog. I really wanted to re-use my existing Nix flakes for those projects, this way I know my local dev env would be the same env then used on CI. I am self-hosting a Gitea instance (will probably be migrating to Forgejo) and it uses a CI system built to resemble Github actions - basically you run your jobs as containers and within those you can run arbitrary commands. [Read More]
nix  nixos  ci  docker  oci 

Containerised Mastodon server on NixOS

If you're here to learn about how to set up a Mastodon server on NixOS the easy way - you can use services.mastodon.enable = true; and take it from there ! This post does describe a bit more convoluted setup than that. I’ve been on the fediverse on and off since friendi.ca started to be a thing. I remember hosting an instance at ponk.pink that suddenly got popular and the server melted away while I was apologising to the users. [Read More]

How to use a non-default ssh port for a Nix distributed build host

I wanted to host my ssh server on a different port than the default 22, this allows me to skip on some spam in the logs, as the default port gets scanned quite often. By changing that on the server I broke distributing my nix builds, as they were using the default port as well. It took me a while to figure out how to configure the port the builder would use so I thought I would share here. [Read More]
nix 

Quick reproducible zig dev env using nix flakes

Want this great feeling of entering a directory and having all your dev setup done but can never remember how to set up nix flakes ? What you’ll need is, in addition to a working direnv with nix and nix flake enabled, is: .envrc: use flake .gitignore: .direnv/ flake.nix (this nixpkgs hash points to the first revision with zig 0.9 present): { inputs = { nixpkgs = { type = "github"; owner = "nixos"; repo = "nixpkgs"; ref = "e1eeb53e64159fbb2610ba7810ed511e4d5c10ca"; }; flake-compat = { url = "github:edolstra/flake-compat"; flake = false; }; }; outputs = { self, nixpkgs, flake-compat }: let pkgs = nixpkgs. [Read More]
zig  nix