Skip to content

Instantly share code, notes, and snippets.

View KoviRobi's full-sized avatar

Kovacsics Robert KoviRobi

  • Cambridge Consultants
  • Cambridge, UK
  • 13:27 (UTC +01:00)
View GitHub Profile
@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;
@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";
;;
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)
MODKEY=Mod4
WMII_TERM=urxvt
base03='#002b36'
base02='#073642'
base01='#586e75'
base00='#657b83'
base0='#839496'
base1='#93a1a1'
base2='#eee8d5'
(define-module (mbe a)
#:use-module (oop goops)
#:export (x y))
(define-generic x)
(define-generic y)
#include "ergodox.h"
#include "debug.h"
#include "action_layer.h"
#include "sendchar.h"
#include "virtser.h"
#define BASE 0 // Default layer
#define MIRROR 1 // Mirrored
#define SYMBOLS 2 // Symbols
#define NUMPAD 3 // Number pad
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p nix-prefetch-git
# vim:ft=sh:
set -euo pipefail
if [[ "${#}" -lt 1 ]]; then
echo "USAGE: nixify <path> [rev]"
echo "Path must exist and must be a directory"
#!/usr/bin/env nix-shell
#! nix-shell -i python -p "(python3.withPackages (p: with p; [ pysrt ]))"
import pysrt
import re
regexp = re.compile(r'\bring\b', flags=re.I)
filename='LOTR1.srt'
subs = pysrt.open(filename)
grep: /home/rmk35/programming/bluespec/connectal/boardinfo/.json: No such file or directory
which: no quartus_sh in (/nix/store/kp60cyq5iig35gzp7l2pr0ilxxa4m919-bash-interactive-4.4-p23/bin:/nix/store/mwfy3ihfydvrjmsimbd2kkr20n9abqsv-patchelf-0.9/bin:/nix/store/1wb31gzrjw055xl6d3igzj1gnajzlwbk-gcc-wrapper-9.2.0/bin:/nix/store/gh9a48qcwzw588vy4w72w93kad0mhhi8-gcc-9.2.0/bin:/nix/store/c2lx3lsqp0y5kwvwkqma8iihc7xjj1m8-glibc-2.30-bin/bin:/nix/store/hzvl3dvv8651iqlb5g6gq5hzjzmhjn7m-coreutils-8.31/bin:/nix/store/ahfsyzh84splz1p5ryj9j1isqgm5739b-binutils-wrapper-2.31.1/bin:/nix/store/nfs9wf6ipffr9g9ylzb4i9c1i607nxvq-binutils-2.31.1/bin:/nix/store/c2lx3lsqp0y5kwvwkqma8iihc7xjj1m8-glibc-2.30-bin/bin:/nix/store/hzvl3dvv8651iqlb5g6gq5hzjzmhjn7m-coreutils-8.31/bin:/nix/store/2vxm66aq8f580x90z6nwc4iglm3ahijh-bluespec-unstable-2020.02.09/bin:/nix/store/im6zg1fqr7fp0q9fmj56p3zacvv36ys9-strace-5.5/bin:/nix/store/78m6fpsrczklmscgy55hxlyfwzwpylab-python-2.7.17-env/bin:/nix/store/hzvl3dvv8651iqlb5g6gq5hzjzmhjn7m-coreutils-8.31/
{ nixpkgs ? import <nixpkgs> {}
}:
with nixpkgs;
stdenv.mkDerivation {
name = "connectal";
version = "1.0.0";
buildInputs = [
bluespec
strace