NixOS / nixops

NixOps is a tool for deploying to NixOS machines in a network or cloud.
https://nixos.org/nixops
GNU Lesser General Public License v3.0
1.84k stars 363 forks source link

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

Open shmish111 opened 3 years ago

shmish111 commented 3 years ago

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 commented 3 years ago

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

shmish111 commented 3 years ago

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 commented 3 years ago

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?