summaryrefslogtreecommitdiff
path: root/pkgs/custom-hello.nix
blob: 9dbd4df77a6294292dfde455ee8c8a62274ca0b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{
  lib,
  stdenv,
  runtimeShell,
}:
stdenv.mkDerivation {
  pname = "hello";
  version = "1.0";

  dontUnpack = true;

  installPhase = ''
    mkdir -p $out/bin
    cat > $out/bin/hello << EOF
    #!${runtimeShell}
    echo "Hello, This is an example nix package!"
    EOF
    chmod +x $out/bin/hello
  '';

  meta = {
    description = "Example package";
    license = lib.licenses.free;
    mainProgram = "hello";
  };
}