Skip to content

Instantly share code, notes, and snippets.

View KoviRobi's full-sized avatar

Kovacsics Robert KoviRobi

  • Cambridge Consultants
  • Cambridge, UK
  • 11:32 (UTC +01:00)
View GitHub Profile
open System;
(* The type
'a IsoRec record
is the same as
type 'a isorec_record = Roll of { n : int; a : int; b : int; f : 'a isorec_record -> 'a }
but apparenty that way of specifying types is deprecated
*)
type 'a record = { n : int; a : int; b : int; f : 'a }
type 'a IsoRec = Roll of ('a IsoRec record -> 'a)
@KoviRobi
KoviRobi / nixos-container-launch.sh
Created December 17, 2014 17:49
This accompanies nixos-container.nix
#!/bin/sh -xeu
restart="false";
echo $#
if [ "$#" -ge 1 ]; then
case "$1" in
"r"|"re"|"res"|"rest"|"resta"|"restar"|"restart")
sudo systemctl stop container@browser
restart="true";
;;
@KoviRobi
KoviRobi / nixos-container.nix
Last active June 7, 2023 11:11
NixOS container example, for a web browser container. Use "sudo systemctl start container@browser" to start.
# vim: set softtabstop=2 tabstop=2 shiftwidth=2 expandtab autoindent syntax=nix nocompatible :
# Containers
{ config, pkgs, ... }:
{ containers.browser =
let hostAddr = "192.168.100.10";
in
{ privateNetwork = true;
hostAddress = hostAddr;