Loading doc/build-helpers/trivial-build-helpers.chapter.md +3 −3 Original line number Diff line number Diff line Loading @@ -501,7 +501,7 @@ writeTextFile { text = '' Contents of File ''; destination = "share/my-file"; destination = "/share/my-file"; } ``` Loading Loading @@ -586,7 +586,7 @@ writeTextFile { echo "hi" ''; executable = true; destination = "bin/my-script"; destination = "/bin/my-script"; } ``` Loading Loading @@ -674,7 +674,7 @@ writeTextFile { echo "hi" ''; executable = true; destination = "bin/my-script"; destination = "/bin/my-script"; } ``` Loading pkgs/build-support/trivial-builders/default.nix +7 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,13 @@ rec { , preferLocalBuild ? true , derivationArgs ? { } }: assert lib.assertMsg (destination != "" -> (lib.hasPrefix "/" destination && destination != "/")) '' destination must be an absolute path, relative to the derivation's out path, got '${destination}' instead. Ensure that the path starts with a / and specifies at least the filename. ''; let matches = builtins.match "/bin/([^/]+)" destination; in Loading Loading
doc/build-helpers/trivial-build-helpers.chapter.md +3 −3 Original line number Diff line number Diff line Loading @@ -501,7 +501,7 @@ writeTextFile { text = '' Contents of File ''; destination = "share/my-file"; destination = "/share/my-file"; } ``` Loading Loading @@ -586,7 +586,7 @@ writeTextFile { echo "hi" ''; executable = true; destination = "bin/my-script"; destination = "/bin/my-script"; } ``` Loading Loading @@ -674,7 +674,7 @@ writeTextFile { echo "hi" ''; executable = true; destination = "bin/my-script"; destination = "/bin/my-script"; } ``` Loading
pkgs/build-support/trivial-builders/default.nix +7 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,13 @@ rec { , preferLocalBuild ? true , derivationArgs ? { } }: assert lib.assertMsg (destination != "" -> (lib.hasPrefix "/" destination && destination != "/")) '' destination must be an absolute path, relative to the derivation's out path, got '${destination}' instead. Ensure that the path starts with a / and specifies at least the filename. ''; let matches = builtins.match "/bin/([^/]+)" destination; in Loading