Skip to content

Instantly share code, notes, and snippets.

@pigam
pigam / flake.nix
Created April 7, 2026 08:33 — forked from voidus/flake.nix
Build a cloudinit image in nixos
{
description = "A nixos cloudinit base image without nixos-infect";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
@pigam
pigam / tables.org
Created April 5, 2024 06:17 — forked from Gavinok/tables.org
Show notes for my video on org tables

Org tables

Creating a table

| |
Designates a table
|-
Followed by a space will create a horizontal line
  • you can navigate them intuitively with tab return etc
    NameAge
    Gavin100
@pigam
pigam / devenv.nix
Created February 13, 2023 17:15
Use a local flake as input in devenv.yaml
{ pkgs, inputs, ... }:
let
extra = inputs.local.devShell."${pkgs.system}".buildInputs;
in
{
packages = [ pkgs.git ] ++ extra;
}
@pigam
pigam / bash_array.bash
Created May 4, 2022 07:03
bash array split/join/unshift
# local -n <- introduce a reference
# requires bash >= 4.3 for nameref
function split {
local str="$1"
local sep="$2"
local -n array=$3
IFS="$sep" read -ra array <<< "$str"
}
function join {
@pigam
pigam / Eval.hs
Last active December 30, 2020 08:28 — forked from kseo/Eval.hs
Monad Transformers Step by Step
module Eval where
import Control.Monad.Identity
import Control.Monad.Error
import Control.Monad.Reader
import Control.Monad.State
import Control.Monad.Writer
import Data.Maybe
import qualified Data.Map as Map
@pigam
pigam / readme.md
Created September 11, 2020 08:15 — forked from rometsch/BH456A_linux_driver.md
MPOW BH456A Bluetooth USB Adapter Kernel Module Adjustements (Realtek RTL8761B chip)

Problem

The MPOW Bluetooth 5 dongle (Model: BH456A) does not work out of the box on Ubuntu 20.04 (kernel 5.4.0-42).

Solution

Patch the bluetooth kernel module and copy the firmware binaries to /etc/firmware.

Copy the fimware

@pigam
pigam / guix.sh
Created April 26, 2020 17:52 — forked from mbakke/guix.sh
Guix on a foreign distribution (/etc/profile.d/guix.sh)
# If GUIX_PROFILE is set while sourcing the profile, the variables will
# refer to that instead of just the latest generation of the profile.
GUIX_PROFILE="${HOME}/.guix-profile"
if [[ -L "${GUIX_PROFILE}" ]]; then
. "${GUIX_PROFILE}/etc/profile"
fi
# Make sure the Guix from "guix pull" appears first in PATH.
export PATH="${HOME}/.config/guix/current/bin:${PATH}"
export INFOPATH="$HOME/.config/guix/current/share/info:$INFOPATH"
data TisAnInteger = TisAn Integer
instance Eq TisAnInteger where
TisAn i == TisAn i' = i == i'
data TwoIntegers = Two Integer Integer
instance Eq TwoIntegers where
Two x y == Two x' y' = x == x' && y == y'
data StringOrInt = TisAnInt Int | TisAString String
instance Eq StringOrInt where