Just finished packaging a C project at work with help of colleagues, and tackled packaging a personal / school project previously. Running Nix on Windows Subsystem for Linux (WSL).
- NixOS/nixos-homepage#855 move Nix Pills to the end of recommendation list, reword logline
The starting point of this session is googling for
package nix cpp, and evaluating the search results:
Not helpful, too many details, and not helpful with something like
Tries first example by reading the instructions, looks at the example (quickly grasps the header of
chord_example.nix, and runs:
The example works on first try.
Continues following the instructions by cloning the example project and building by entering
nix-shell. Doesn’t try the
nix-shell --commandversion of the instruction, inferring that it will yield the same result, and that the only difference is that it will enter the development environment, build the project, and then exit.
Remarks that it’s really hard to find an introduction for declaring a C/C++ development environment.
Moving onto the next article: Packaging Your First Experiment
Fairly proficient with the shell, but still not sure what
nix-shelldoes exactly, other than creating a special environment.
This article appears less focused on Nix and more on the software to be built and run. Continues reading it regardless.
Clones the project, and tries to re-use the example Nix file as a template for a personal project, but not familiar with C development, and wondering why both
cmake is needed.
Copies example file into own project.
Stops for a second at
srcand changes it to
./.(remembers this from Nix Pills, Chapter 7.) (Doesn’t understand what
revis for in the example anyway - maybe has something to do with the URL?)
mv chord $out/bin
nix-shell own-project.nix, builds it, and it works
Interviewer: How would you make the project, and run it in your environment, outside of
Participant: Would build it somehow.
nix-build, gets a CMake error, but not familiar enough with CMake and Nix to make adjustments.
- NixOS/nix.dev#882 make nix.dev official
Session ends here.