Skip to content

Instantly share code, notes, and snippets.

View YellowOnion's full-sized avatar

Daniel Hill YellowOnion

  • Christchurch, New Zealand
  • 23:42 (UTC +13:00)
View GitHub Profile
======================
Proton: 1767307616 GE-Proton10-28
SteamGameId: 1142710
Command: ['/home/daniel/.local/share/Steam/steamapps/common/Total War WARHAMMER III/Warhammer3.exe']
Options: {'forcelgadd'}
depot: 3.0.20260218.209091
pressure-vessel: 0.20260218.0
scripts: 0.20260218.0
sniper: 3.0.20260218.209091 sniper 3.0.20260218.209091
Kernel: Linux 6.19.0 #1-NixOS SMP PREEMPT_DYNAMIC Sun Feb 8 21:03:27 UTC 2026 x86_64
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE OverloadedLabels #-}
module Kairos where
import Data.IORef
import Data.Word
import Data.Int
import qualified Data.HashMap.Strict as Map
{ config, lib, pkgs, ... }:
let
systemctl = "/run/current-system/systemd/bin/systemctl";
in
{
services.udev.extraRules = ''
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_TYPE}=="Battery", ENV{POWER_SUPPLY_STATUS}=="Discharging", RUN+="${systemctl} start on-battery.target"
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_TYPE}=="Battery", ENV{POWER_SUPPLY_STATUS}=="Charging", RUN+="${systemctl} stop on-battery.target"
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_TYPE}=="Mains", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="${systemctl} start on-mains.target"
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_TYPE}=="Mains", ENV{POWER_SUPPLY_STATUS}=="0", RUN+="${systemctl} stop on-mains.target"
Device 0: /dev/sdi TOSHIBA MG08ACA1
Bucket size: 2.00M
Device 1: /dev/sdj TOSHIBA MG10ACA2
Bucket size: 2.00M
Device 2: /dev/sdk TOSHIBA MG10ACA2
Bucket size: 2.00M
Device 3: /dev/sdl TOSHIBA MG10ACA2
Bucket size: 2.00M
Device 4: /dev/sdm TOSHIBA MG10ACA2
Bucket size: 2.00M
Jan 31 22:07:47 Purple-Sunrise kernel: Linux version 6.18.2 (nixbld@localhost) (gcc (GCC) 14.3.0, GNU ld (GNU Binutils) 2.44) #1-NixOS SMP PREEMPT_DYNAMIC Thu Dec 18 13:03:43 UTC 2025
Jan 31 22:07:47 Purple-Sunrise kernel: Command line: initrd=\EFI\nixos\a5975795hpknjb7vr3k0v0nfpzi2yc0b-initrd-linux-6.18.2-initrd.efi init=/nix/store/w89v42qp3llj16lmndh9nnmmkd65lbp9-nixos-system-Purple-Sunrise-26.05.20251227.3edc4a3/init amd_pstate=active hid_apple.fnmode=0 amdgpu.ppfeaturemask=0xfffffffb loglevel=4 lsm=landlock,yama,bpf
Jan 31 22:07:47 Purple-Sunrise kernel: BIOS-provided physical RAM map:
Jan 31 22:07:47 Purple-Sunrise kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009ffff] usable
Jan 31 22:07:47 Purple-Sunrise kernel: BIOS-e820: [mem 0x00000000000a0000-0x00000000000fffff] reserved
Jan 31 22:07:47 Purple-Sunrise kernel: BIOS-e820: [mem 0x0000000000100000-0x0000000009d1efff] usable
Jan 31 22:07:47 Purple-Sunrise kernel: BIOS-e820: [mem 0x0000000009d1f000-0x0000000009ffffff] reserved
Jan 31 22:07:47 Pur
boot -0
-- No entries --
boot -1
mce: [Hardware Error]: Machine check events logged
mce: [Hardware Error]: CPU 17: Machine Check: 0 Bank 5: bea0000000000108
mce: [Hardware Error]: TSC 0 ADDR 7f21ce93c294 MISC d01a000000000000 SYND 4d000000 IPID 500b000000000
mce: [Hardware Error]: PROCESSOR 2:a20f12 TIME 1769850447 SOCKET 0 APIC b microcode a201213
mce: [Hardware Error]: Machine check events logged
[Hardware Error]: Corrected error, no action required.
[Hardware Error]: CPU:1 (19:21:2) MC15_STATUS[Over|CE|MiscV|-|PCC|-|-|-|-]: 0xdb84000037e2e802
boot -1
mce: [Hardware Error]: Machine check events logged
mce: [Hardware Error]: CPU 17: Machine Check: 0 Bank 5: bea0000000000108
mce: [Hardware Error]: TSC 0 ADDR 7f21ce93c294 MISC d01a000000000000 SYND 4d000000 IPID 500b000000000
mce: [Hardware Error]: PROCESSOR 2:a20f12 TIME 1769850447 SOCKET 0 APIC b microcode a201213
mce: [Hardware Error]: Machine check events logged
[Hardware Error]: Corrected error, no action required.
[Hardware Error]: CPU:1 (19:21:2) MC15_STATUS[Over|CE|MiscV|-|PCC|-|-|-|-]: 0xdb84000037e2e802
[Hardware Error]: IPID: 0x0000000000000000
[Hardware Error]: Bank 15 is reserved.
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE BangPatterns #-}
import System.PosixCompat.Files
import System.PosixCompat.Types (DeviceID)
import Control.Exception (bracket_, evaluate, catch, handle, try, IOException)
import Control.Concurrent
nixos-config on  master [$!?⇡]
❯ jj git init
Done importing changes from the underlying Git repo.
Warning: Refused to snapshot some files:
packages/abyss/dist-newstyle/build/x86_64-linux/ghc-9.10.3/abyss-0.1.0.0/build/abyss/abyss: 2.8MiB (2988200 bytes); the maximum size allowed is 1.0MiB (1048576 bytes)
packages/abyss/dist-newstyle/build/x86_64-linux/ghc-9.10.3/abyss-0.1.0.0/build/exe/exe: 2.8MiB (2897816 bytes); the maximum size allowed is 1.0MiB (1048576 bytes)
packages/abyss/dist-newstyle/build/x86_64-linux/ghc-9.10.3/abyss-0.1.0.0/setup/setup: 16.7MiB (17554000 bytes); the maximum size allowed is 1.0MiB (1048576 bytes)
packages/abyss/dist-newstyle/build/x86_64-linux/ghc-9.10.3/abyss-0.1.0.0/setup-config: 1.2MiB (1210297 bytes); the maximum size allowed is 1.0MiB (1048576 bytes)
packages/abyss/dist-newstyle/build/x86_64-linux/ghc-9.10.3/abyss-0.1.0.0/x/abyss/build/abyss/abyss: 2.8MiB (2988200 bytes); the maximum size allowed is 1.0MiB (1048576 bytes)
packages/abyss/dist-newstyle/build/x86_64-
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Main where
import qualified Data.ByteString.Lazy as LBS
import qualified Text.Megaparsec as P
import qualified Text.Megaparsec.Char as P
import qualified Data.Text as T
import qualified Data.Text.IO as T