nixpkgs/pkgs/applications/misc/hello-unfree/default.nix
Jörg Thalheim dadc7eb329
treewide: use runtimeShell instead of stdenv.shell whenever possible
Whenever we create scripts that are installed to $out, we must use runtimeShell
in order to get the shell that can be executed on the machine we create the
package for. This is relevant for cross-compiling. The only use case for
stdenv.shell are scripts that are executed as part of the build system.
Usages in checkPhase are borderline however to decrease the likelyhood
of people copying the wrong examples, I decided to use runtimeShell as well.
2019-02-26 14:10:49 +00:00

24 lines
554 B
Nix

{ stdenv, runtimeShell }:
stdenv.mkDerivation rec {
name = "example-unfree-package-${version}";
version = "1.0";
phases = [ "installPhase" "fixupPhase" ];
installPhase = ''
mkdir -p $out/bin
cat > $out/bin/hello-unfree << EOF
#!${runtimeShell}
echo "Hello, you are running an unfree system!"
EOF
chmod +x $out/bin/hello-unfree
'';
meta = {
description = "An example package with unfree license (for testing)";
license = stdenv.lib.licenses.unfree;
maintainers = [ stdenv.lib.maintainers.oxij ];
};
}