nix-dot-dev / getting-started-devenv-template

Based on nix.dev tutorials, repository template to get you started with Nix.
https://nix.dev
473 stars 27 forks source link

How do I use this? #13

Open anka-213 opened 4 years ago

anka-213 commented 4 years ago

I have trouble figuring out where to place my code in this template? Could you add a concrete example of building a package with this (or whatever this template is meant for)?

domenkozar commented 4 years ago

That's a good point, maybe I should add an example hello world package.

anka-213 commented 4 years ago

Thanks! That sounds good.

brotherdust commented 4 years ago

I second this. If one wants to be opinionated, it would be good to describe why particular opinionated decisions about the template were made. What value do these decisions create for the user? Once that is understood, provide a step by step example of how to use this template to generate a package for say, an application that does not yet have a presence in nixpkgs. I.E. "not my software, but I want to make a package for it and contribute it back to the community".

My particular use case is that I want to make a nixpkg for FRR. How would this project make it easier to generate said package and how would one go about doing that?

Thanks much! Nix4evar!

duckpuppy commented 3 years ago

This does seem like it's trying to be useful, but without more docs I have no idea where to put anything... like, say, the actual derivation build. And I can't find an example of anyone using this template on Github to learn from.

domenkozar commented 3 years ago

I'm going to get back to this in the next couple of weeks!

mjschock commented 3 years ago

in case it helps as an example, i stumbled across this article https://rgoswami.me/posts/ccon-tut-nix/#project-local-pip which helped me get a Python 3.6 env with Numpy and Pandas up by changing shell.nix to this:

{ project ? import ./nix { }
}:
let
  pythonEnv = project.pkgs.python36.withPackages (ps: with ps;[
    numpy
    pandas
  ]);

in project.pkgs.mkShell {
  buildInputs = with builtins.attrValues project.devTools; [
    pythonEnv
  ];
  shellHook = ''
    ${project.ci.pre-commit-check.shellHook}
  '';
}
domenkozar commented 1 year ago

Since the launch of https://devenv.sh I've introduced it for this template, what do you think? Does it make easier to get started?