Skip to content

Instantly share code, notes, and snippets.

View carnotweat's full-sized avatar

sameer gupta carnotweat

View GitHub Profile
@hedning
hedning / gnome-shell-record.py
Created January 18, 2020 14:21
Start gnome shell screen cast from command line
#!/usr/bin/env nix-shell
#! nix-shell -i python3 -p python3.pkgs.dbus-python
import dbus
import time
bus = dbus.SessionBus()
obj = bus.get_object("org.gnome.Shell", "/org/gnome/Shell/Screencast")
obj.Screencast("Auto %d %t.webm", [],
dbus_interface="org.gnome.Shell.Screencast")
@siraben
siraben / tagless-final-concat.hs
Created December 19, 2020 04:05
Tagless final concatenative programming
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleInstances #-}
import Prelude (Bool,Show, (+))
import qualified Prelude as P
import Control.Arrow
import Control.Monad
import Control.Category
data s :. a = s :. a
{
description = "A very basic flake";
inputs.nixpkgs.url = github:nixos/nixpkgs/21.11;
inputs.flake-utils.url = github:numtide/flake-utils;
inputs.llvm-repo = {
flake = false;
# url = github:llvm/llvm-project?ref=a6d081b2cbc3348ed7261254ae7a563146b76d23;
url = github:llvm/llvm-project?ref=d7b669b3a30345cfcdb2fde2af6f48aa4b94845d; # 13.0.0
@carnotweat
carnotweat / 01_NixOS_Prefix_delegation_with_fixed_DUID.md
Created June 23, 2024 10:08 — forked from gleber/01_NixOS_Prefix_delegation_with_fixed_DUID.md
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.