2015-08-28 19:31:59 +00:00
|
|
|
{ lib, pkgs, ... }:
|
2015-07-24 10:03:51 +00:00
|
|
|
|
2015-08-28 19:43:16 +00:00
|
|
|
with import ../4lib { inherit lib; };
|
|
|
|
|
2015-07-24 10:03:51 +00:00
|
|
|
let
|
|
|
|
inherit (pkgs) callPackage;
|
|
|
|
in
|
|
|
|
|
|
|
|
pkgs //
|
2015-08-28 19:43:16 +00:00
|
|
|
rec {
|
2015-08-05 22:21:40 +00:00
|
|
|
cac = callPackage ./cac.nix {};
|
2015-07-24 21:24:46 +00:00
|
|
|
dic = callPackage ./dic.nix {};
|
2015-07-24 21:19:49 +00:00
|
|
|
genid = callPackage ./genid.nix {};
|
2015-07-24 10:03:51 +00:00
|
|
|
github-hosts-sync = callPackage ./github-hosts-sync.nix {};
|
|
|
|
github-known_hosts = callPackage ./github-known_hosts.nix {};
|
2015-07-24 21:16:48 +00:00
|
|
|
hashPassword = callPackage ./hashPassword.nix {};
|
2015-08-27 18:35:50 +00:00
|
|
|
nq = callPackage ./nq.nix {};
|
2015-08-16 11:40:00 +00:00
|
|
|
posix-array = callPackage ./posix-array.nix {};
|
2015-08-28 19:31:59 +00:00
|
|
|
|
2015-08-28 19:43:16 +00:00
|
|
|
execve = name: { filename, argv, envp }:
|
|
|
|
writeC name {} ''
|
|
|
|
#include <unistd.h>
|
|
|
|
int main () {
|
|
|
|
const char *filename = ${toC filename};
|
|
|
|
char *const argv[] = ${toC (argv ++ [null])};
|
|
|
|
char *const envp[] = ${toC (
|
|
|
|
mapAttrsToList (k: v: "${k}=${v}") envp ++ [null]
|
|
|
|
)};
|
|
|
|
execve(filename, argv, envp);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
|
2015-08-28 19:31:59 +00:00
|
|
|
writeC = name: {}: src: pkgs.runCommand name {} ''
|
|
|
|
PATH=${lib.makeSearchPath "bin" (with pkgs; [
|
|
|
|
binutils
|
|
|
|
coreutils
|
|
|
|
gcc
|
|
|
|
])}
|
|
|
|
in=${pkgs.writeText "${name}.c" src}
|
|
|
|
gcc -O -Wall -o $out $in
|
|
|
|
strip --strip-unneeded $out
|
|
|
|
'';
|
2015-07-24 10:03:51 +00:00
|
|
|
}
|