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

Can't upgrade nix.package to nix20 #76

Closed
corps opened this issue May 6, 2018 · 3 comments
Closed

Can't upgrade nix.package to nix20 #76

corps opened this issue May 6, 2018 · 3 comments

Comments

@corps
Copy link

corps commented May 6, 2018

Hi there,

I currently have a setup using the latest version of nix-darwin, and a fairly recent nixpkgs checkout. If I enable nix.package = pkgs.nix, my darwin-rebuild switch fails.

I'm using a nix.nixPath that looks something like this:

nix.nixPath = [
    "darwin-config=$HOME/.nixpkgs/darwin-configuration.nix"
     ("nixpkgs=" + (import ../../packages/darwin-nixpkgs { inherit lib; }))
     "/nix/var/nix/profiles/per-user/root/channels"
     "$HOME/.nix-defexpr/channels"
];

Which basically is fixing my nixpkgs path to a specific checkout url. This works totally fine, until I add the nix.package = pkgs.nix line. The failure looks like this:

warning: unknown setting 'signed-binary-caches'
warning: unknown setting 'signed-binary-caches'
warning: unknown setting 'signed-binary-caches'
error: imported archive of ‘/nix/store/bwls0n1kp1zf3ssxmj1xmk3aqg5qllxc-ff3fe105f209a5e934b4062a9259e1e0cc587c8e.tar.gz’ lacks a signature
error: Changed <nixpkgs> but target does not exist, aborting activation
Add a nixpkgs channel or set nix.nixPath:
$ nix-channel --add http://nixos.org/channels/nixpkgs-unstable nixpkgs
$ nix-channel --update

or set

warning: unknown setting 'signed-binary-caches'
error: imported archive of ‘/nix/store/bwls0n1kp1zf3ssxmj1xmk3aqg5qllxc-ff3fe105f209a5e934b4062a9259e1e0cc587c8e.tar.gz’ lacks a signature
    nix.nixPath = [ "nixpkgs=" ];

I've tried setting nix.requiresSignedPackages to false, but it doesn't seem to help. It looks like my nix-daemon config is receiving settings for nix2.0, while running the 1.11 version?

What's the proper way to have darwin-rebuild be capable of upgrading nix itself? I have a few different mac machines that need a similar upgrade and allowing a single setting file + darwin-rebuild switch would be ideal :) I do know I could probably fix this by manually upgrading my nix on the default profile, but that feels like I'm losing the power of darwin nix. Is there something I"m missing?

@LnL7
Copy link
Owner

LnL7 commented May 6, 2018

The nix 1.11 daemon is not forward compatible with the 2.0 client. Most things work but IFD is one example that doesn't, the nixPath sanity checks fail because of that. I don't think there's a nice way to handle that automatically since the check is correct and should run with the target nix version.

Add this to your configuration temporarily to disable the checks until the daemon is upgraded.

{ config, lib, pkgs, ... }:
with lib;
{
  system.activationScripts.checks.text = mkForce "";
}

That warning is normal and will disappear when the system is upgraded, you can just ignore it.

@corps
Copy link
Author

corps commented May 8, 2018

Thank you for the suggestion! Removing the check worked and the upgrade went fine. Since I know I want to upgrade to 2.0 for all my machines, I borrowed the isNix20 logic check and made this conditional, worked like a charm.

@LnL7
Copy link
Owner

LnL7 commented May 8, 2018

Don't keep it in your config tho, the checks work once the daemon is running >=2.0

@corps corps closed this as completed Jul 2, 2018
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

No branches or pull requests

2 participants