···4455## `runCommand` {#trivial-builder-runCommand}
6677-This takes three arguments, `name`, `env`, and `buildCommand`. `name` is just the name that Nix will append to the store path in the same way that `stdenv.mkDerivation` uses its `name` attribute. `env` is an attribute set specifying environment variables that will be set for this derivation. These attributes are then passed to the wrapped `stdenv.mkDerivation`. `buildCommand` specifies the commands that will be run to create this derivation. Note that you will need to create `$out` for Nix to register the command as successful.
77+`runCommand :: String -> AttrSet -> String -> Derivation`
88+99+`runCommand name drvAttrs buildCommand` returns a derivation that is built by running the specified shell commands.
81099-An example of using `runCommand` is provided below.
1111+`name :: String`
1212+: The name that Nix will append to the store path in the same way that `stdenv.mkDerivation` uses its `name` attribute.
1313+1414+`drvAttr :: AttrSet`
1515+: Attributes to pass to the underlying call to [`stdenv.mkDerivation`](#chap-stdenv).
1616+1717+`buildCommand :: String`
1818+: Shell commands to run in the derivation builder.
1919+2020+ ::: {.note}
2121+ You have to create a file or directory `$out` for Nix to be able to run the builder successfully.
2222+ :::
2323+2424+::: {.example #ex-runcommand-simple}
2525+# Invocation of `runCommand`
10261127```nix
1228(import <nixpkgs> {}).runCommand "my-example" {} ''
···2844 date
2945''
3046```
4747+:::
31483249## `runCommandCC` {#trivial-builder-runCommandCC}
3350