From 865765aece83690d673f2db2533300eb36fdb6b8 Mon Sep 17 00:00:00 2001
From: nonsequitur <cornelius.mika@gmail.com>
Date: Mon, 14 Aug 2017 10:10:14 +0200
Subject: [PATCH] ruby docs: improve example

1. Call `nix-build` with `--no-out-link` to avoid cluttering the source dir.
2. Re-add `patchShebangs`, since `buildCommand` doesn't imply a patch phase. (It was my fault to remove this in the first place, sorry!)
---
 doc/languages-frameworks/ruby.xml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/languages-frameworks/ruby.xml b/doc/languages-frameworks/ruby.xml
index 647a30481e3..6bb809192f8 100644
--- a/doc/languages-frameworks/ruby.xml
+++ b/doc/languages-frameworks/ruby.xml
@@ -20,7 +20,7 @@ $ cd sensu
 $ cat > Gemfile
 source 'https://rubygems.org'
 gem 'sensu'
-$ $(nix-build '<nixpkgs>' -A bundix)/bin/bundix --magic
+$ $(nix-build '<nixpkgs>' -A bundix --no-out-link)/bin/bundix --magic
 $ cat > default.nix
 { lib, bundlerEnv, ruby }:
 
@@ -114,6 +114,7 @@ in stdenv.mkDerivation {
   script = ./my-script.rb;
   buildCommand = ''
     install -D -m755 $script $out/bin/my-script
+    patchShebangs $out/bin/my-script
   '';
 }]]>
 </programlisting>