summaryrefslogtreecommitdiffstats
path: root/krebs
diff options
context:
space:
mode:
authorlassulus <lass@lassul.us>2017-03-07 21:51:59 +0100
committerlassulus <lass@lassul.us>2017-03-07 21:51:59 +0100
commitc938c30187352e417ec4fe0d129a9374b8566ed6 (patch)
tree8c0989db92b68dad68bf709720ed529d0e0b8795 /krebs
parent484dc992f83bd7d6aadd6d7621f973ab824777d8 (diff)
parent0edb13f3fc16e6456e5deb4e006595491a6b197e (diff)
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'krebs')
-rw-r--r--krebs/5pkgs/writers.nix26
1 files changed, 26 insertions, 0 deletions
diff --git a/krebs/5pkgs/writers.nix b/krebs/5pkgs/writers.nix
index 65ee1448..e1dbed5c 100644
--- a/krebs/5pkgs/writers.nix
+++ b/krebs/5pkgs/writers.nix
@@ -2,6 +2,32 @@
with import <stockholm/lib>;
{
nixpkgs.config.packageOverrides = _: {
+
+ # Combine a list of derivations using symlinks. Paths in later derivations
+ # take precedence over earlier ones.
+ #
+ # Example: create wrapper but retain all other files (man pages etc.)
+ #
+ # {
+ # nixpkgs.config.packageOverrides = super: {
+ # hello = pkgs.concat "hello" [
+ # super.hello
+ # (pkgs.writeDashBin "hello" ''
+ # echo OMG
+ # echo exec ${super.hello}/bin/hello "$@"
+ # '')
+ # ];
+ # };
+ # }
+ #
+ concat = name: xs: pkgs.runCommand name {} ''
+ mkdir $out
+ ${flip concatMapStrings xs (x: ''
+ cp --remove-destination -vrs ${x}/* $out
+ find $out -type d -exec chmod -v u+rwx {} +
+ '')}
+ '';
+
execve = name: { filename, argv ? null, envp ? {}, destination ? "" }: let
in pkgs.writeC name { inherit destination; } /* c */ ''
#include <unistd.h>