Skip to content

Instantly share code, notes, and snippets.


Moritz Angermann angerman

View GitHub Profile
angerman /
Last active May 20, 2021
Installing nix on macOS BigSur

The website suggests to use:

sh <(curl -L

For macOS on Intel (x86_64) or Apple Silicon (arm64) based macs, we need to use

sh <(curl -L --darwin-use-unencrypted-nix-store-volume

Installing NixOS on the RockPi4 (B)

The general plan is to build an sd-image-aarch64 from nixpkgs/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix flash it to the eMMC and have the system come up, similar to how this “just works” for raspberry-pis.

The RockPi 4 is a RockChip RK3399 based board, build by radxa with the same formfactor as a rasperry Pi. One noticable difference is that the Rock Pi’s cpu is at the bottom to better allow for the

angerman /
Created Nov 27, 2020
Cross compiling ws-tunnel
# prefetch wstunnel's master for nix, and store the result in wstunnel.json
nix-prefetch-git > wstunnel.json
# and build the wstunnel-tarball with nix, using the haskell.nix infra structure as above (see default.nix)
nix build \
-f default.nix \
rpi64-musl.wstunnel-tarball \
-o rpi64-musl-wstunnel-tarball
--arg wstunnel-json ./ws-tunnel.json
View report2.txt
NoFib Results
Program Size Allocs Runtime Elapsed TotalMem
CS -0.1% 0.0% 0.122 0.122 0.0%
CSD -0.1% 0.0% +2.6% +2.6% 0.0%
FS -0.3% 0.0% -2.4% -2.5% 0.0%
S -0.0% 0.0% +0.1% +0.1% 0.0%
VS -0.1% 0.0% +4.0% +3.9% 0.0%
View report.txt
NoFib Results
Program Size Allocs Runtime Elapsed TotalMem
CS -4.6% 0.0% 0.122 0.122 0.0%
CSD -4.7% 0.0% +38.2% +38.3% 0.0%
FS -4.8% 0.0% +12.7% +12.7% 0.0%
S -4.6% 0.0% +0.0% +0.1% 0.0%
VS -4.6% 0.0% +9.0% +9.1% 0.0%
View tsan.log
This file has been truncated, but you can view the full file.
Listening on
WARNING: ThreadSanitizer: data race (pid=11658)
Read of size 8 at 0x558007ab3e90 by thread T41:
#0 tryWakeupThread rts/Threads.c:253 (cardano-node+0x160cd49)
#1 unpark_tso rts/STM.c:353 (cardano-node+0x16440a6)
#2 unpark_waiters_on rts/STM.c:370 (cardano-node+0x16440a6)
#3 stmCommitTransaction rts/STM.c:1105 (cardano-node+0x16440a6)
#4 stg_atomically_frame_info <null> (cardano-node+0x16390d3)
angerman /
Created Jul 11, 2020
Thoughts on GitLab, Phabricator, ...

A central piece of modern collaborative software development is done using source control tools. One of the most prominent being git. While this is by no means the only one, it is probably the most commonly used one with a cottage industry of tooling around it.

While git is conceptually decentralised, it is mostly used though a central server. Today this central server is often GitHub, or to some degree GitLab, and even a lesser some other hosted options. This provides value in that it's easily accessable from a browser (the ubiquitous way to access information today), and provides discovery facilities.

However, one can argue that the most critical part of collaborative software development is

View 0001-ghc-prim-ghc-prim-needs-to-depend-on-libc-and-libm.patch
From 0bba971db4bcada2a39e151816c2dc16444455d6 Mon Sep 17 00:00:00 2001
From: Moritz Angermann <>
Date: Thu, 14 May 2020 08:10:43 +0800
Subject: [PATCH 1/9] [ghc-prim] ghc-prim needs to depend on libc and libm
libm is just an empty shell on musl, and all the math functions are contained in
libraries/ghc-prim/ghc-prim.cabal | 5 +++++
1 file changed, 5 insertions(+)
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p python3 --pure
import sys
from pprint import pprint
stack = []
timestack = []
n = 0
angerman /
Created Dec 8, 2019 — forked from nh2/
Example script to install NixOS on a Hetzner dedicated server via the Hetzner rescue mode
#!/usr/bin/env bash
# Installs NixOS on a Hetzner server, wiping the server.
# This is for a specific server configuration; adjust where needed.
# Prerequisites:
# * Update the script to adjust SSH pubkeys, hostname, NixOS version etc.
# Usage: