Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to current nix / nixops #4

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Conversation

rened
Copy link

@rened rened commented Oct 27, 2014

This updates the scripts to be useable again, with the current versions of nix (1.8pre) / nixops (1.3pre), including a workaround for an outdated nix inside the VMs which prevents deployment.

Tested on 10.9 with XCode 5.1 and 10.10. with XCode 6.1

It fetches the latest binary builds for nix and nixops - this should be pinned to the release versions once available.

This also fixes #2.

@ghost
Copy link

ghost commented Nov 21, 2014

Hi everyone,

I grabbed this PR as a patch, and used git am to apply it.

I then had to apply this patch:

diff --git a/install-nixops.sh b/install-nixops.sh
index 469b552..4cbb027 100755
--- a/install-nixops.sh
+++ b/install-nixops.sh
@@ -7,7 +7,7 @@ nix-channel --update
 export NIX_PATH=/nix/var/nix/profiles/per-user/$USER/channels/nixos

 # get the .nixpkg URL of the latest darwin build of nixops
-URL=`curl -sL http://hydra.nixos.org/job/nixops/master/build.x86_64-darwin/latest | grep .nixpkg | grep href | grep -o \
+URL=`curl -sL http://hydra.nixos.org/job/nixops/master/build.x86_64-darwin/latest | grep '\.nixpkg"' | grep href | grep 
 nix-install-package --non-interactive --url $URL

 RCFILE=~/.profile

to get install-nixops.sh to work correctly.

I seem to have my environment set up correctly:

psnively@Ragnarok ~$ nix-env --version
nix-env (Nix) 1.8pre3866_6062b12
psnively@Ragnarok ~$ nixops --version
NixOps 1.3pre1358_10aae84
psnively@Ragnarok ~$ echo $NIX_PATH
/nix/var/nix/profiles/per-user/psnively/channels/nixos

But:

psnively@Ragnarok ~/projects/nixops-mac-setup[master*]$ nixops create test/trivial-vbox.nix test/trivial.nix -d test
created deployment ‘ec890aa8-719d-11e4-a0d7-80e6502616e8’
ec890aa8-719d-11e4-a0d7-80e6502616e8
psnively@Ragnarok ~/projects/nixops-mac-setup[master*]$ nixops deploy -d test
error: Package ‘qemu-2.0.0’ in ‘/nix/var/nix/profiles/per-user/psnively/channels/nixos/nixpkgs/pkgs/applications/virtualization/qemu/default.nix:50’ is not supported on ‘x86_64-darwin’, refusing to evaluate.
You can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this. If you use Nix standalone, you can add
  { allowBroken = true; }
to ~/.nixpkgs/config.nix.

(use ‘--show-trace’ to show detailed location information)
error: evaluation of the deployment specification failed

I'm at a loss to understand why qemu even enters into it, for a VirtualBox deployment.

Any advice?

Thanks!

@rened
Copy link
Author

rened commented Nov 21, 2014

What happens when you set allowBroken = true? I am pretty new to nixops myself, but it might be that the expressions are evaluated first, and only then it looks for a build machine. And the evaluation only sees the local architecture, as it does not know about the target yet. But I am just guessing here...

@ghost
Copy link

ghost commented Nov 21, 2014

@rened, unfortunately I run bang into a failed assertion in libcap that the platform is Linux.

I think you're right: when I add --show-trace, it does look like something is trying to operate over all packages, and this entails evaluation. But this cannot possibly work: some packages are platform-specific, and some include assertions to that effect. Nix seems very hostile to correctly handling staging, where we have a build environment that's different from the target environment. Recent versions of this repo claim a remote build VM is not necessary anymore. To be honest, I don't believe it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nix-channel update needs to be run or suggested to run
1 participant