jonringer / nix-template

Make creating nix expressions easy
Creative Commons Zero v1.0 Universal
206 stars 8 forks source link

Add noob-friendly `--documentation-links` option #1

Closed Pamplemousse closed 3 years ago

Pamplemousse commented 3 years ago

Hi @jonringer!

I got to see your chat with @zimbatm on Nix friday, where you mentioned working on this project. Loved the idea, and reading through the README.md, I got inspired by the --comments item you left on your Roadmap.

Not sure you accept contributions to this project, but I tried out something and figured you might be interested: This PR adds a --documentation-links (or -d) option to add links to relevant sections of the Nixpkgs contributor guide.

And whether you want it or not: Thanks for nix-template!

jonringer commented 3 years ago

That's a great idea :)

jonringer commented 3 years ago

LGTM

[nix-shell:/home/jon/projects/nix-template]$ ./target/debug/nix-template stdenv --stdout -d -pname test -v 1
{ lib, stdenv, fetchFromGitHub }:

# See the guide for more information: https://nixos.org/nixpkgs/manual/#sec-using-stdenv
stdenv.mkDerivation rec {
  pname = "name";
  version = "1";

  # See the guide for more information: https://nixos.org/nixpkgs/manual/#chap-pkgs-fetchers
  src = fetchFromGitHub {
    owner = "CHANGE";
    repo = pname;
    rev = "CHANGE";
    sha256 = "0000000000000000000000000000000000000000000000000000";
  };

  # See the guide for more information: https://nixos.org/nixpkgs/manual/#ssec-stdenv-dependencies
  buildInputs = [ ];

  # See the guide for more information: https://nixos.org/nixpkgs/manual/#chap-meta
  meta = with lib; {
    description = "CHANGE";
    homepage = "https://github.com/CHANGE/name/";
    license = license.CHANGE;
    maintainers = with maintainers; [  ];
  };
}
jonringer commented 3 years ago

I think when I implement --comments it will imply document links as well