nix-community / nixpkgs-update

Updating nixpkgs packages since 2018
Creative Commons Zero v1.0 Universal
415 stars 68 forks source link

error: cannot evaluate a function that has an argument without a value ('lib') #423

Open anatawa12 opened 3 months ago

anatawa12 commented 3 months ago

I tried to install this package in nixos/nix container, error occurs.

I'm trying to use nixpkgs-update as suggested on https://github.com/NixOS/nixpkgs/pull/302297#issuecomment-2041437193.

bash-5.2# nix-env \
  --option extra-substituters 'https://nix-community.cachix.org/' \
  --option extra-trusted-public-keys 'nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=' \
  -if https://github.com/ryantm/nixpkgs-update/archive/main.tar.gz
warning: name collision in input Nix expressions, skipping '/nix/store/aiv5k9i17b5zxzf78r8prz2mdgy1953m-source/rust/flake.nix'
error: cannot evaluate a function that has an argument without a value ('lib')
       Nix attempted to evaluate a function as a top level expression; in
       this case it must have its arguments supplied either by default
       values, or passed explicitly with '--arg' or '--argstr'. See
       https://nixos.org/manual/nix/stable/language/constructs.html#functions.
       at /nix/store/aiv5k9i17b5zxzf78r8prz2mdgy1953m-source/nixpkgs-update.nix:4:29:
            3| , hspec, hspec-discover, http-client, http-client-tls, http-conduit
            4| , http-types, iso8601-time, lib, lifted-base, mtl
             |                             ^
            5| , neat-interpolation, optparse-applicative, parsec, parsers
willbush commented 3 months ago

I'm not too sure what's going on with nix-env in the container and I also can't get nix shell to work, but nix run works when enabling flakes and nix-command features:

❯ docker run -it nixos/nix
bash-5.2# nix run \
  --extra-experimental-features nix-command \
  --extra-experimental-features flakes \
  --option extra-substituters 'https://nix-community.cachix.org/' \
  --option extra-trusted-public-keys 'nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=' \
  github:ryantm/nixpkgs-update -- --help
do you want to allow configuration setting 'extra-substituters' to be set to 'https://nix-community.cachix.org' (y/N)? y
do you want to permanently mark this value as trusted (y/N)? y
do you want to allow configuration setting 'extra-trusted-public-keys' to be set to 'nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=' (y/N)? y
do you want to permanently mark this value as trusted (y/N)? y
nixpkgs-update

Usage: nixpkgs-update COMMAND

  Update packages in the Nixpkgs repository

Available options:
  -h,--help                Show this help text

Available commands:
  update                   Update one package
  update-batch             Update one package in batch mode.
  delete-done              Deletes branches from PRs that were merged or closed
  version                  Displays version information for nixpkgs-update and
                           dependencies
  update-vulnerability-db  Updates the vulnerability database
  check-vulnerable         checks if something is vulnerable
  check-all-vulnerable     checks all packages to update for vulnerabilities
  source-github            looks for updates on GitHub
  fetch-repology           fetches update from Repology and prints them to
                           stdout