concat: init

This commit is contained in:
tv 2017-03-07 21:48:25 +01:00
parent c05db24090
commit 0edb13f3fc

View File

@ -2,6 +2,32 @@
with import <stockholm/lib>; with import <stockholm/lib>;
{ {
nixpkgs.config.packageOverrides = _: { 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 execve = name: { filename, argv ? null, envp ? {}, destination ? "" }: let
in pkgs.writeC name { inherit destination; } /* c */ '' in pkgs.writeC name { inherit destination; } /* c */ ''
#include <unistd.h> #include <unistd.h>