Nixpkgs: nixops broken in master

Created on 15 Nov 2018  路  19Comments  路  Source: NixOS/nixpkgs

Issue description

https://github.com/NixOS/nixpkgs/pull/47684 added a pkgs argument which is not passed in nixops: https://github.com/NixOS/nixops/blob/master/nix/eval-machine-info.nix#L9

This results in the following failure:

error: anonymous function at /home/joerg/git/nixpkgs/nixos/lib/testing.nix:1:1 called without required argument 'pkgs', at /home/joerg/git/nixops/nix/eval-machine-info.nix:9:6
error: evaluation of the deployment specification failed

Steps to reproduce

$ nixops deploy -d <any-deployment>

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.14.80, NixOS, 19.03.git.b43a02a (Koi)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.1.3
  • channels(root): "nur"
  • channels(joerg): "home-manager"
  • nixpkgs: /home/joerg/git/nixpkgs

All 19 comments

actually it is this commit introducing pkgs: 6c68fbd4e1f8beac39cb1f499ff90c78256262d6

cc @Ekleog

@Mic92 Nixops relies on nixos/lib/build-vms.nix? I assumed it was internal to Nixpkgs, given it's not, afaik, documented anywhere.

I guess a fix would be to replace pkgs by pkgs ? import ../.. { inherit system config; }, if we indeed want build-vms.nix to be a public interface of Nixpkgs, along with adding a comment warning that this file is public interface and used by nixops :)

I have no idea why it is actually using this file.
It dates back to very early versions of nixops: https://github.com/NixOS/nixops/commit/bac59ad1b04516510e9c67bbd82b3d310084b2ac#diff-6f15e27c3e048b98302b636c2b8f983bR7

I was able to replace with with import <nixpkgs> {} any problems for my setup.

Hmm, so I聽guess it's maybe a nixops bug then?

My fix was merged, I hope it did not break something else. Nevertheless it is still an improvement over the current state.

@Mic92 nixops not worked in latest commit

nix-info -m
 - system: `"x86_64-linux"`
 - host os: `Linux 4.18.19, NixOS, 19.03.git.41391e9 (Koi)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.2pre6526_9f99d624`
 - channels(root): `"nixos-19.03pre159478.44f24a1b8c4"`
 - channels(home): `"nixos-18.09pre150245.ecd9d74d973"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs`

error:

error: anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/lib/testing.nix:1:1 called without required argument 'pkgs', at /nix/store/gqnkwh6m77l4g6gwjma60nlwszwzk571-nixops-1.6.1pre2622_f10999a/share/nix/nixops/eval-machine-info.nix:9:6
error: evaluation of the deployment specification failed

This is not the latest commit, you need: d5ad09cd3db5ed096d1bd17fbe5a0790b434f2c7

I already asked to prepare a release: https://github.com/NixOS/nixops/pull/1050

I update nixopsUnstable in this pr: https://github.com/NixOS/nixpkgs/pull/50525

I'm still getting the same error. I'm relatively new to nix/nixops. I cloned the repo, installed it, and I still get this when I run nixops deploy -d trivial (following the tutorial)

error: anonymous function at /home/wes/.nix-defexpr/channels/nixpkgs/nixos/lib/testing.nix:1:1 called without required argument 'pkgs', at /nix/store/prki8c8z7zih01q3nzsp3d6wprv8ymai-nixops-1.6/share/nix/nixops/eval-machine-info.nix:9:6
error: evaluation of the deployment specification failed

What branch do I need to be on for the fix? How do I verify that I have the latest release?

Nevermind, I didn't realize the nix-build command doesn't actually install it to /nix. It seems to work now

Thanks, worked.

nixpkgs channel for macos is still broken. Do we just have to wait for the build finish?

@juskrey I guess so. You can also checkout the nixops repository and run the ./dev-shell script to get a runnable nixops command or you override src in the nixops package.

@juskrey If you are on stable, I should probably backport nixopsUnstable to that branch.

This is broken for me as well,

called without required argument 'pkgs', at /nix/store/nm5agxh5aaclwm8gpyxbamawq4lpb62s-python2.7-nixops-1.6.1pre0_abcdef/share/nix/nixops/eval-machine-info.nix

This is not the right version! Should be nixops-1.6.1pre2706_d5ad09c

When I tested nixops-1.6.1pre2706_d5ad09c on my Mac, it hung when I tried to deploy/destroy a small deployment to VisualBox. I decided to delete the vm from VisualBox and try again. Then it gave me an error from VBoxManage: could not find a virtual machine. Duh! I thought it would just create it. That is what the old version of nixops would do.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

copumpkin picture copumpkin  路  3Comments

copumpkin picture copumpkin  路  3Comments

yawnt picture yawnt  路  3Comments

grahamc picture grahamc  路  3Comments

rzetterberg picture rzetterberg  路  3Comments