Files
nix-writers/examples/hello_world.nix

34 lines
800 B
Nix
Raw Normal View History

2018-09-11 20:07:04 +02:00
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"
'';
2018-09-23 13:05:11 +02:00
js = pkgs.writeJS "hello-world" {} ''
console.log("hello world")
'';
2018-09-12 14:57:09 +02:00
perl = pkgs.writePerl "hello-world" {} ''
print "hello world\n";
'';
2018-09-11 20:07:04 +02:00
python3 = pkgs.writePython3 "hello-world" {} ''
print("hello world")
'';
sed = pkgs.writeDash "sed-example" ''
echo xxx | ${pkgs.writeSed "hello-world" "s/xxx/hello world/"}
'';
}