From c1623add688b215cdfd5ddb574cf668bc5bc27e5 Mon Sep 17 00:00:00 2001 From: Paul Brinkmeier Date: Thu, 15 Apr 2021 18:45:22 +0200 Subject: [PATCH] doc: add note about staging flake.nix (#411) If you don't make flake.nix visible to Git, nix build etc. won't work. Add a command that adds the file to the Index and a note explaining why. --- doc/setup.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/setup.md b/doc/setup.md index e719fc83ac..01bbd28de5 100644 --- a/doc/setup.md +++ b/doc/setup.md @@ -75,8 +75,10 @@ Note: Your system Nix might print warnings about not knowing some of the setting From a Lean shell, run ```bash $ nix flake new mypkg -t github:leanprover/lean4 +$ cd mypkg && git init && git add flake.nix ``` to create a new Lean package in directory `mypkg` using the latest commit of Lean 4. +Note that Nix Flakes will not recognize your `flake.nix` file unless it is visible to Git. Such packages follow the same directory layout as described in the basic setup above, except for a `leanpkg.toml` replaced by a `flake.nix` file set up so you can run Nix commands on it, for example: ```bash $ nix build # build package and all dependencies