diff options
author | tv <tv@shackspace.de> | 2015-08-28 21:31:59 +0200 |
---|---|---|
committer | tv <tv@shackspace.de> | 2015-08-28 21:31:59 +0200 |
commit | c1aaaca7f7febe0c587342ae74e7045bb9a67c5a (patch) | |
tree | cadfdb8d3968e7e3dea817bfba255d78a3c9de9c /krebs/5pkgs | |
parent | f6997378c91be84432703183397f8675143030e9 (diff) |
krebs += pkgs.writeC lib.toC
Diffstat (limited to 'krebs/5pkgs')
-rw-r--r-- | krebs/5pkgs/default.nix | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/krebs/5pkgs/default.nix b/krebs/5pkgs/default.nix index 2149b6f10..c8fb1d2d7 100644 --- a/krebs/5pkgs/default.nix +++ b/krebs/5pkgs/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ lib, pkgs, ... }: let inherit (pkgs) callPackage; @@ -14,4 +14,15 @@ pkgs // hashPassword = callPackage ./hashPassword.nix {}; nq = callPackage ./nq.nix {}; posix-array = callPackage ./posix-array.nix {}; + + 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 + ''; } |