Skip to content

Instantly share code, notes, and snippets.

Robert Hensing roberth

View GitHub Profile
roberth / FP workshop
Last active December 8, 2016 20:15
Links for a Haskell workshop at Software Circus meetup 2016-12-09 Amsterdam

Keybase proof

I hereby claim:

To claim this, I am signing this object:


nix-shell is a tool unlike any other for working with project dependencies. However, so much more can be done! A lot of this can already be accomplished with nix-shell, so a simple approach might be to fix the flaws in nix-shell and leave the rest of the effort for the community to figure out. That's very modular, but doesn't improve the situation much beyond the status quo. In fact, solutions like IDEs and docker-compose currently provide better solutions for some of the problems (but are stuck in local optima).


  • Build dependencies
  • Merge dependencies (buildEnv)
roberth / nix-shell-bash-completion.nix
Last active June 27, 2018 17:10
Bash completion and more in nix-shell
pkgs.mkShell {
buildInputs = [...];
shellHook = ''
local dirs="$(find $buildInputs -mindepth 1 -maxdepth 1 -path '*/share' -printf ':%p')"
export XDG_DATA_DIRS=''${XDG_DATA_DIRS:-}''${XDG_DATA_DIRS:+''${dirs:+:}}''${dirs}
roberth / dhall-lenient.hs
Created July 1, 2018 20:39
Allow weird stuff when reading Dhall, like redundant fields
module LambdaCI.CLI.Config where
import Prelude()
import Protolude
import System.Directory
import qualified Data.Text.IO as T
import Dhall hiding (Text)
import Dhall.Pretty(prettyExpr, annToAnsiStyle)
roberth / Extras.hs
Created November 12, 2018 16:08
Katip higher order scribes
--| Didn't need this after all, but, at least conceptually, this is kind of nice.
module Katip.Extras where
import Protolude
import Data.IORef
import Katip
ioScribe :: IO Scribe
-> IO () -- ^ Finalizer, see 'scribeFinalizer'
roberth / Gate.hs
Created November 26, 2018 17:55
Idea for stopping work gracefully
module Control.Concurrent.Extras.Gate where
import Protolude
import Data.IORef
import Control.Concurrent.STM
import Data.UUID
import qualified Data.UUID.V4 as UUID
import qualified Data.Map as M
-- | State of a multi-task process to help with graceful termination
roberth / gist:9699dacf4286afb73f60a792e6ce64c3
Created April 10, 2019 13:03
Rebase with formatting change
git checkout feature-branch
git commit -m 'Buffer' --allow-empty
git rebase -i <origin/master or similar>
# uncomment buffer commit, reorder into
# pick Buffer
# <pick feature-branch commits>
git filter-branch --tree-filter './scripts/format-all' <origin/master or similar>..HEAD
# inspect the new Buffer commit and act accordingly
roberth / service-private-nix-daemon.nix
Created May 22, 2019 09:38
arion draft private nix store daemon service
# Import this module from an arion service to enable the nix daemon.
{ pkgs, lib, ... }:
# You're probably looking for service.useHostNixDaemon instead of this module.
service.useHostStore = lib.mkForce false; # DID YOU READ THE COMMENT?
nixos.configuration = { pkgs, lib, ...}: {
roberth / example.nix
Created June 21, 2019 09:26
concurrent, event sourced, side effecting Nix via bash
{ io, args, ... }:
main =
io.printLine "I'm hi, who are you?" ask;
ask =
io.readLine (name: