diff options
author | tv <tv@krebsco.de> | 2018-09-18 19:29:19 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2018-09-18 19:29:19 +0200 |
commit | cf9ac094e0f6d9649f050452c0df539281237e54 (patch) | |
tree | a4ffecdc2b856198c777ec8d951227af8466a53a /examples/hello_world.nix | |
parent | c27a9416e8ee04d708b11b48f8cf1a055c0cc079 (diff) | |
parent | 16b43f218d142de49fbd8fae77e6e2c057bfb9d6 (diff) |
Merge remote-tracking branch 'lass/master'derp
Diffstat (limited to 'examples/hello_world.nix')
-rw-r--r-- | examples/hello_world.nix | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/examples/hello_world.nix b/examples/hello_world.nix new file mode 100644 index 0000000..4944c13 --- /dev/null +++ b/examples/hello_world.nix @@ -0,0 +1,33 @@ +let + pkgs = import <nixpkgs> { overlays = [ (import ../pkgs) ]; }; +in { + bash = pkgs.writeBash "hello-world" '' + echo 'hello world' + ''; + c = pkgs.writeC "hello-world" {} '' + #include <stdio.h> + int main() { + printf("hello world\n"); + return 0; + } + ''; + dash = pkgs.writeDash "hello-world" '' + echo 'hello world' + ''; + haskell = pkgs.writeHaskell "hello-world" [] '' + main = do + putStrLn "hello world" + ''; + perl = pkgs.writePerl "hello-world" {} '' + print "hello world\n"; + ''; + python2 = pkgs.writePython2 "hello-world" {} '' + print "hello world" + ''; + python3 = pkgs.writePython3 "hello-world" {} '' + print("hello world") + ''; + sed = pkgs.writeDash "sed-example" '' + echo xxx | ${pkgs.writeSed "hello-world" "s/xxx/hello world/"} + ''; +} |