Skip to content

Instantly share code, notes, and snippets.

import Language.Haskell.TH
f n m = do
nm1 <- newName "x"
let b = replicate (m - 1) WildP
a = replicate (n - m) WildP
return (LamE [TupP (b++[VarP nm1]++a)] (VarE nm1))

Keybase proof

I hereby claim:

  • I am gleber on github.
  • I am gleber (https://keybase.io/gleber) on keybase.
  • I have a public key whose fingerprint is 01BB 7ECD F093 F407 AD0C 5D1A 56C7 5D02 E9F0 4E6B

To claim this, I am signing this object:

@gleber
gleber / 01_NixOS_Prefix_delegation_with_fixed_DUID.md
Last active June 23, 2024 10:08
Configuring ipv6 with dhcpcd using static DUID in NixOS 17.03 (e.g. on online.net servers)

I was trying to configure native ipv6 on my NixOS box, which is running in online.net's datacenters. They provide you a /48 or smaller subnet and a DUID which is used during DHCP. In dhcpcd vocabulary DUID is called clientid.

online.net's help page about IPv6 configuration was not very useful, since NixOS uses dhcpcd by default. The page which allowed me to make it all work was https://community.online.net/t/tutorial-ipv6-with-dhcpcd/3804

It looks like the only really required entries in networking.dhcpcd.extraConfig are interface and static though. I assumed that clientid is also necessary, but it looks like dhcpcd cares much more about content of /etc/dhcpcd.duid. Of course replace enp2s0 with the name of the main interface.

@gleber
gleber / README.md
Last active March 23, 2025 15:51
X.Tips X7S Keyboard (2024-04)