1
0
Fork 0
mirror of https://github.com/NixOS/nix-pills synced 2024-09-19 04:00:13 -04:00

07-working-derivation.md: use derivation instead of mkDerivation

When switching from the nix repl to a nix file, `derivation` was replaced with `pkgs.stdenv.mkDerivation`. This was not explained, and the examples work fine without this. It seems to me that when learning that you can define the derivation in a nix file instead of in the repl, there's no need to add another change.

I see that the next chapter uses plain `derivation` in the first examples, and then defines a new function `mkDerivation`. So I'm pretty certain that we should just use plain `derivation` here.
This commit is contained in:
Noam Yorav-Raphael 2024-04-09 22:50:29 +03:00 committed by GitHub
parent 05407a5a2f
commit c91af2ecc1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -189,7 +189,7 @@ Drop out of nix repl and write a file `simple.nix`:
let let
pkgs = import <nixpkgs> { }; pkgs = import <nixpkgs> { };
in in
pkgs.stdenv.mkDerivation { derivation {
name = "simple"; name = "simple";
builder = "${pkgs.bash}/bin/bash"; builder = "${pkgs.bash}/bin/bash";
args = [ ./simple_builder.sh ]; args = [ ./simple_builder.sh ];
@ -222,7 +222,7 @@ Below is a revised version of the `simple.nix` file, using the `inherit` keyword
let let
pkgs = import <nixpkgs> { }; pkgs = import <nixpkgs> { };
in in
pkgs.stdenv.mkDerivation { derivation {
name = "simple"; name = "simple";
builder = "${pkgs.bash}/bin/bash"; builder = "${pkgs.bash}/bin/bash";
args = [ ./simple_builder.sh ]; args = [ ./simple_builder.sh ];