Instantly share code, notes, and snippets.

View default.nix
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "arcan";
version="1";
src = ./.;
nativeBuildInputs = with pkgs; [
cmake git
] ;
CMAKE_CXX_FLAGS = "-msse4.1";
DRM_INCLUDE_DIR = "${pkgs.libdrm.dev}/include/libdrm";
View ralink-dtb.patch
View ilo.ino
#define RELAY_PIN (8)
void setup() {
// put your setup code here, to run once:
SERIAL_PORT_USBVIRTUAL.begin(115200); // open serial connection via USB-Serial
pinMode(RELAY_PIN, OUTPUT);
pinMode(LED_BUILTIN, OUTPUT);
}
View abstract.md

Title

NixWRT: purely functional firmware images for IoT devices

Abstract

Reflashing your broadband router with Linux (DD-WRT or OpenWRT or Tomato or variants) gives you unparalleled flexibility to do things that the manufacturer probably hadn't thought of. Remembering what you did, six months later, is often trickier.

View boot.log
reboot: Reÿÿ
U-Boot 1.1.4 (Mar 2 2012 - 15:15:23)
AP121-2MB (ar9330) U-boot
DRAM: 32 MB
Top of RAM usable for U-Boot at: 82000000
Reserving 161k for U-Boot at: 81fd4000
Reserving 192k for malloc() at: 81fa4000
View push_github_release.rb
#!/usr/bin/env ruby
require 'uri'
require 'net/http'
require 'json'
require 'pathname'
@api_root = URI("https://api.github.com")
remote = `git config --local remote.origin.url`.chomp
View backuphost.nix
with import <nixpkgs> {};
let
platform = {
uboot = null;
endian = "big";
name = "yun";
kernelArch = "mips";
gcc = { abi = "32"; } ;
bfdEmulation = "elf32btsmip";
kernelHeadersBaseConfig = "ath79_defconfig";
View blonk.ino
#include <Adafruit_NeoPixel.h>
#define CW_PIN 5
#define CCW_PIN 6
#define FUNCTION_PIN 9
#define HUE (A1)
#define BRIGHTNESS_POT (A2)
#define STRIP_PIN 2
View mipskernel.nix
with import <nixpkgs> {
crossSystem = {
system = "mipsel-linux-gnu";
withTLS = true;
platform = {
uboot = null;
name = "malta";
kernelArch = "mips";
kernelBaseConfig = "malta_defconfig";
kernelHeadersBaseConfig = "malta_defconfig";
View landmine.rb
class Landmine
def initialize(replaces)
@replaces = replaces
end
def method_missing(n, *args)
raise "#{@replaces} landmine triggered by method #{n}: #{args.join ','}"
end
end