Skip to content

Instantly share code, notes, and snippets.


Vladimír Čunát vcunat

View GitHub Profile
vcunat / schema.json
Created Jan 11, 2022
knot-resolver schema for YAML/JSON config [experimental]
View schema.json
{"$schema": "", "type": "object", "properties": {"server": {"type": "object", "properties": {"hostname": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null}, "groupid": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null}, "nsid": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null}, "workers": {"anyOf": [{"enum": ["auto"]}, {"type": "integer"}], "default": 1}, "use_cache_gc": {"type": "boolean", "default": true}, "backend": {"enum": ["auto", "systemd", "supervisord"], "default": "auto"}, "watchdog": {"anyOf": [{"enum": [false]}, {"type": "object", "properties": {"qname": {"type": "string"}, "qtype": {"enum": ["A", "A6", "AAAA", "AFSDB", "ANY", "APL", "ATMA", "AVC", "AXFR", "CAA", "CDNSKEY", "CDS", "CERT", "CNAME", "CSYNC", "DHCID", "DLV", "DNAME", "DNSKEY", "DOA", "DS", "EID", "EUI48", "EUI64", "GID", "GPOS", "HINFO", "HIP", "HTTPS", "IPSECKEY", "ISDN", "IXFR", "KEY", "KX", "L32", "L64", "LOC", "LP", "MAILA", "MAILB", "MB"
vcunat /
Last active Jul 24, 2018 — forked from grahamc/
don't force dig to use IPv4
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bind.dnsutils -p traceroute -p curl
# impure: needs ping
function _e {
echo "> $@"
eval "$@" 2>&1 | sed -e "s/^/ /"
printf "Exit: %s\n\n\n" "$?"
View release.nix
{ nixpkgs ? <nixpkgs> }: {
inherit (import nixpkgs {}) hello;
vcunat /
Last active Jan 10, 2017
For proving github account ownership

Keybase proof

I hereby claim:

  • I am vcunat on github.
  • I am vcunat ( on keybase.
  • I have a public key whose fingerprint is B600 6460 B60A 80E7 8206 2449 E747 DF1F 9575 A3AA

To claim this, I am signing this object:

vcunat / default.nix
Created Dec 4, 2016
Linux->mingw cross-compiling shim: *-native is for packages not meant to be run on windows
View default.nix
lib = (import <nixpkgs> {}).lib;
pkgs-cross-xx = hostArch:
(name_: pkg: if lib.isDerivation pkg then pkg.crossDrv else pkg)
(pkgs-cross-xx-nocross hostArch);
pkgs-cross-xx-nocross = hostArch:
(import <nixpkgs> {
crossSystem = {
config = hostArch + "-w64-mingw32";
#!/usr/bin/env bash
if [ "$#" != 2 ]; then
echo "Usage: $0 commit-hash commit-hash"
echo -e "\tYou need to be in a git-controlled nixpkgs tree."
exit 1
echo "Estimating rebuild amount, by packages visible to nix-env:"
echo "(If you get 0, it's an evaluation error, most likely.)"
vcunat / zbar.nix
Created Jul 26, 2016
Zbar: nix expression for linux->mingw cross-compilation, both 32 and 64-bit.
View zbar.nix
{stdenv, fetchurl, pkgconfig, xmlto, imagemagick, libiconv}:
stdenv.mkDerivation rec {
name = "zbar-0-10";
src = fetchurl {
url =;
sha256 = "1imdvf5k34g1x2zr6975basczkz3zdxg6xnci50yyp5yvcwznki3";
vcunat / R.log
Last active Jan 2, 2016
Failure while linking R, using NIX_DEBUG=1 to show linker flags
View R.log
original flags to /nix/store/vck6gcw6acfj5zbclaxq95dkx8askvc0-binutils-2.23.1-dev/bin/ld:
vcunat / xmonad.hs
Last active Aug 29, 2015
My XMonad config
View xmonad.hs
import Data.List
import Data.Maybe (fromMaybe)
import qualified Data.Map as M
import XMonad
import XMonad.Config.Xfce (xfceConfig)
--import XMonad.Config.Gnome
--import XMonad.Config.Kde
import XMonad.Config.Desktop (desktopLayoutModifiers)
View nvidia-HW-support.diff
--- /home/admin/nix/tmp/nvidia-long.txt
+++ /home/admin/nix/tmp/nvidia-short.txt
@@ -1,9 +1,15 @@
+GeForce 900 Series:
+GeForce GTX 980, GeForce GTX 970
+GeForce 900M Series (Notebooks):
+GeForce GTX 980M, GeForce GTX 970M
GeForce 800M Series (Notebooks):