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
View foo.nix
# something along these lines. we add preConfigure so that python
# doesn't choke with some error about "not a valid wheel file name"
# and we override postInstall not to create the docbook manual
# because it failed and it was easier to do that than fix it
nixopsMaster = lib.overrideDerivation pkgs.nixops (a: rec {
version = "1.6pre1_1675d7a";
name = "nixops-${version}";
# as of this date, no released version of nixops supports
# writing /etc/hosts with the libvirtd backend
View boot_build.clj
;; this is src/myproject/boot_build.clj
(ns myproject.boot-build
(:require [boot.core :as core]
[cemerick.pomegranate.aether :as aether]
[boot.util :as util]
[boot.pod :as pod]
[clojure.java.io :as io]
[clojure.string :as str]
[cheshire.core :as json]