Skip to content

Instantly share code, notes, and snippets.


Vincent Ambo tazjin

View GitHub Profile
tazjin / buildGo.nix
Created Nov 23, 2019
Bazel-style build rules for Go, but in Nix
View buildGo.nix
# Copyright 2019 Google LLC.
# SPDX-License-Identifier: Apache-2.0
# buildGo provides Nix functions to build Go packages in the style of Bazel's
# rules_go.
{ pkgs ? import <nixpkgs> {}
, ... }:
tazjin /
Last active Sep 28, 2019
Documentation languages

Documentation format popularity

The SQL query below queries the [GitHub dataset on Google BigQuery][bq] for information about the popularity of different documentation formats.

Identification is based on file extensions in this version, and duplicates (e.g. READMEs across forks) are deduplicated by content hashes (which the table uses for the identifiers).

tazjin /
Last active Aug 18, 2019
Knotty - a featureless IRC bot


(knotty = Nix + bot + y, duh!)

Knotty is an IRC bot with functionality that is defined by its users. It uses the [Nix][] package manager's [language][nix-1p] for all logic.


This program reads an export reference graph (i.e. a graph representing the runtime dependencies of a set of derivations) created by Nix and groups them in a way that is likely to match the grouping for other derivation sets with overlapping dependencies.

This is used to determine which derivations to include in which layers of a container image.


tazjin /
Last active Oct 4, 2019
Yet Another Nix Type System (aka YANTS)


Note: Yants now has its own repository.

This is a tiny type-checker for data in Nix, written in Nix.


tazjin /
Last active Aug 1, 2019
Nix Language Overview

This Gist Has Moved!

Please find its new home at

The updated version contains more information and has issue tracking, hooray!

Nix - A One Pager

View keyboard.el
(defun set-xkb-layout (layout)
"Set the current X keyboard layout."
(shell-command (format "setxkbmap %s" layout))
(message "Set X11 keyboard layout to '%s'" layout))
(lambda (pair)
(kbd (format "s-%s" (cadr pair)))
tazjin /
Last active Sep 7, 2020
Nix builder for Kubernetes
tazjin / cargo-update.txt
Created Oct 5, 2018
house cleaning in journaldriver
View cargo-update.txt
~/s/journaldriver $ cargo update
Updating registry ``
Removing adler32 v1.0.2
Updating aho-corasick v0.6.4 -> v0.6.8
Removing arrayvec v0.4.7
Adding ascii v0.9.1
Updating atty v0.2.10 -> v0.2.11
Updating backtrace v0.3.8 -> v0.3.9
Updating backtrace-sys v0.1.21 -> v0.1.24
Updating base64 v0.9.1 -> v0.9.3
tazjin /
Created Sep 24, 2018
journald priority decorator for log4rs
/// Implementation of a log-encoder decorator that can prepend
/// journald log priorities to any given `log4rs`-encoder.
struct JournaldDecorator<E: Encode>(E);
/// Helper function to map from `log`-crate log levels to journald log
/// priorites. Please see `sd-daemon(3)` for detailed information on
/// these levels.
fn journald_priority(level: &Level) -> &'static str {
match level {
You can’t perform that action at this time.