DeterminateSystems / zero-to-nix

Zero to Nix is your guide to learning Nix and flakes. Created by Determinate Systems.

Home Page:https://zero-to-nix.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chapter 3: flake in non empty-directory

alper opened this issue · comments

I'm following along until this bit:

To get started in your Rust project, create an empty directory and initialize a flake template

So I thought because it's about a Rust project I could do the same in the non-empty directory of an existing Rust project. This however causes it to catastrophically error without recovery.

Is there a reason why the directory should be empty?

That's because the template is a full-fledged Rust project. If you initialize it in the current directory, it overrides any existing project files.

So I thought because it's about a Rust project I could do the same in the non-empty directory of an existing Rust project. This however causes it to catastrophically error without recovery.

I fixed this by adding the flake.nix to git which seems to be necessary for it to be picked up and copied to the nix store in a git project.