I tried nix-update attribute with a working default.nix file containing a python package and it failed ("error: anonymous function at... called without required argument 'lib'", the derivation does have lib as the fist argument), so I assumed that it only works within nixpkgs infrastructure.
nix-update expected a package set (an attribute set of nix packages) rather than a single package.
So if you want to update a single package do the following:
# stored as default.nix
{ pkgs ? with import <nixpkgs> {} }:
{
mypackage = pkgs.callPackage ./my-package {};
}
Than you can run nix-update mypackage in the same directory:
Thanks, I have about a hundred python packages which are either not in nixpkgs or are outdated there. Unfortunately they are not up to nixpkgs standards (disabled tests, never tested on many platforms, etc.) so it would not be easy for me to create PRs for them. They are loaded from overlays so I would need to create that file to list all of them. My current solution is to use this quick and dirty bash/curl/jq/sed script Update default.nix for a python package by querying Pypi · GitHub.
Are there plans to make nix-template also fetch the license? It seems trivial as you’d expect, at least GitHub’s API, to expose that information. And if not to read the file and match it against your own database
Mostly a bug fix release, but 0.2.0 is now released.
Changes:
- Breaking Changes / Behaviors:
- Flake template now requires -p,--pname
- Nix expresions now have input attrs in comma-leading style (one input per line)
- Fixes:
- --from-url no longer errors with --nixpkgs when a pname is not supplied
- Fix differences of writing to stdout vs file
- Update flake template (overlay usage)
- Failures from already existing file locations occur sooner
- Particularly irritating with `--from-url`, which would compute release and sha256 info