Nix-template v0.1.0
I wrote a small cli utility to help facilitate the addition of new packages into nixpkgs or into local repositories.
It’s still rough around the edges, but might be useful for some. Currently I’m thinking of making --nixpkgs,-n
the default to be true. And add another --local
switch to not assume nixpkgs.
PR to add to nixpkgs: nix-template: init at 0.1.0 by jonringer · Pull Request #96713 · NixOS/nixpkgs · GitHub
Repo: GitHub - jonringer/nix-template: Make creating nix expressions easy
Copied from README.md:
# only need to config once per user
$ nix-template config name jonringer
$ nix-template config nixpkgs-root /home/jon/projects/nixpkgs
# add a package
$ nix-template python --nixpkgs -pname requests -f pypi -l asl20
Creating directory: /home/jon/projects/nixpkgs/pkgs/development/python-modules/requests/
Generating python expression at /home/jon/projects/nixpkgs/pkgs/development/python-modules/requests/default.nix
Please add the following line to the approriate file in top-level:
requests = callPackage ../development/python-modules/requests { };
# pkgs/development/python-modules/requests/default.nix
{ lib, buildPythonPackage, fetchPypi }:
buildPythonPackage rec {
pname = "requests";
version = "0.0.1";
src = fetchPypi {
inherit pname version;
sha256 = "0000000000000000000000000000000000000000000000000000";
};
propagatedBuildInputs = [ ];
pythonImportsCheck = [ "requests" ];
meta = with lib; {
description = "CHANGEME";
homepage = "https://github.com/CHANGEME/requests/";
license = licenses.asl20;
maintainer = with maintainers; [ jonringer ];
};
}
EDIT: Also wanted to mention @Pamplemousse who made the first PR against my project