Created
August 3, 2018 14:43
-
-
Save thoughtpolice/ac5ecc46a922b4b886e03b9548f194bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with import <nixpkgs> {}; | |
let | |
source = lib.writeFile "something.cc" '' | |
#include <stdio.h> | |
int main(void) { printf("%d\n", 42); return 0; } | |
''; | |
in | |
stdenv.mkDerivation { | |
name = "example"; | |
phases = [ "buildPhase" ]; | |
buildPhase = '' | |
mkdir -p $out/bin | |
cc -o $out/bin/example ${source} | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment