From e10d36bec7e4fb8cb82162c2e9bc86e58f2d5a0e Mon Sep 17 00:00:00 2001
From: makefu <github@syntax-fehler.de>
Date: Mon, 31 Aug 2015 19:56:47 +0200
Subject: [PATCH] add sample of how to extend the Reaktor config

---
 makefu/1systems/pornocauster.nix         |  2 ++
 makefu/2configs/Reaktor/simpleExtend.nix | 21 +++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 100644 makefu/2configs/Reaktor/simpleExtend.nix

diff --git a/makefu/1systems/pornocauster.nix b/makefu/1systems/pornocauster.nix
index 415c1af30..1e2c31257 100644
--- a/makefu/1systems/pornocauster.nix
+++ b/makefu/1systems/pornocauster.nix
@@ -23,6 +23,8 @@
       ../2configs/virtualization.nix
       ../2configs/wwan.nix
 
+      ../2configs/Reaktor/simpleExtend.nix
+
       # hardware specifics are in here
       ../2configs/tp-x220.nix
     ];
diff --git a/makefu/2configs/Reaktor/simpleExtend.nix b/makefu/2configs/Reaktor/simpleExtend.nix
new file mode 100644
index 000000000..3b55ca412
--- /dev/null
+++ b/makefu/2configs/Reaktor/simpleExtend.nix
@@ -0,0 +1,21 @@
+{ config, lib, pkgs, ... }:
+
+with pkgs;
+let
+  nixos-version-script = pkgs.writeScript "nix-version" ''
+  #! /bin/sh
+  . /etc/os-release
+  echo "$PRETTY_NAME"
+  '';
+in {
+  krebs.Reaktor.enable = true;
+  krebs.Reaktor.nickname = "test-reaktor";
+  krebs.Reaktor.extraConfig = ''
+  public_commands.insert(0,{
+    'capname' : "nixos-version",
+    'pattern' : indirect_pattern.format("nixos-version"),
+    'argv'    : ["${nixos-version-script}"],
+    'env'     : { 'state_dir': workdir } })
+  '';
+}
+