No simple template with a proper build / dependency example

Open
#6 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Domain
build-system

Research direction

Start by inspecting the existing defaultTemplate, templates#trivial, simpleContainer, bash-hello, rust-web-server, and compat templates. Add a small flake template demonstrating a development environment and a simple Makefile build for a non-Nix project, with dependencies visible and instructions sufficient to use nix develop.

Written by the indexing model from the issue text.

Description

The templates feature for nix flake seems like a great opportunity to offer easy-setup build environments, particularly for individuals working on non-nix projects and just getting started.

One template I was unable to find was a simple example that's sufficient for nix develop and a simple Makefile build. That is, a template that might serve as a replacement for a simple default.nix / shell.nix, but follow the new flake pattern

with (import <nixpkgs> {});
stdenv.mkDerivation {
   name = "foo";
   buildInputs = [ ... ];
}

But the defaultTemplate and templates#trivial both just build an existing package, without any clarity as to build inputs / dev environment.

On the other hand, there are examples like simpleContainer, bash-hello, and rust-web-server are comparatively large, including nixos modules, VM tests, system compatibility, and other features.

Compat creates legacy default.nix/shell.nix files but doesn't show a fresh flake.nix

Can a template be added for a small reasonable build, such as for building a project which was not originally developed using nixpkgs? Possibly for a particular language like C but which in that case could be readily adapted

Dominant language
Nix
Stars
768
Forks
104
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NixOS/templates

All issues in NixOS/templates

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.