nixops icon indicating copy to clipboard operation
nixops copied to clipboard

on OSX "(stdenv).isLinux failed" despite having localSystem set

Open shmish111 opened this issue 3 years ago • 3 comments

Using current nixops master branch to deploy configuration to an EC2 Nixos instance, I have the following nixops config:

{ webserver = { config, pkgs, lib, ... }:
  { nixpkgs.localSystem.system = "x86_64-linux";
    deployment.targetHost = "10.0.4.96";
  };
  network.description = "Test";
}

When I run nixops deploy I get

error: assertion (stdenv).isLinux failed at /nix/store/wffb1cv7pkc6nvgclndivs20xiq563g6-nixpkgs-20.09.2338.3d2d8f281a2/nixpkgs/pkgs/os-specific/linux/kernel/generic.nix:66:1
(use '--show-trace' to show detailed location information)

while building all machine configurations...

I have a remote builder that works and I can build x86_64-linux things. What am I doing wrong?

shmish111 avatar Dec 21 '20 18:12 shmish111

Seems to be related to https://github.com/NixOS/nixops/issues/560

shmish111 avatar Dec 22 '20 10:12 shmish111

Additionally if I add --option system x86_64-linux I can get much further (having internet issues so I'm not sure how far yet) however https://github.com/NixOS/nixops/issues/560#issuecomment-403224195 says you should not use this option. I'm not quite sure why.

shmish111 avatar Dec 22 '20 11:12 shmish111

so, adding --option system x86_64-linux almost works. It will try to do some builds on the machine it is supposed to be deploying to but these fail for some reason (presumably because this machine is not set up as a remote builder). If I take the derivation that failed and nix-build /nix/store/thederivation.drv then it will successfully build it on the proper remote builder that I have set up. I can then do nixops deploy --option system x86_64-linux which will work because everything is in my local nix store now.

So the new question is, why is nixops trying to build things on the target machine rather than my remote builder?

shmish111 avatar Dec 22 '20 21:12 shmish111