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

unable to upgrade declarative nixos container. #12396

Closed
mogorman opened this issue Jan 15, 2016 · 5 comments
Closed

unable to upgrade declarative nixos container. #12396

mogorman opened this issue Jan 15, 2016 · 5 comments

Comments

@mogorman
Copy link
Contributor

I have a container defined in my nixos configuration.conf

  containers.test = {
    autoStart = true;
    privateNetwork = true;
    hostAddress = "10.137.137.1";
    localAddress = "10.137.137.3";
    config = { configs, pkgs, ... }: {
      system.stateVersion = "unstable";
      system.defaultChannel = "https://nixos.org/channels/unstable";
      boot.isContainer = true;
      networking.hostName = "test";
      networking.useDHCP = false;
      environment.systemPackages = with pkgs; [ bash hello ];
    };
  };

I have tried to make the container upgrade from 15.09 to unstable but it does not seem to work. I also tried adding the channel and upgrading from within the container but this also fails because there is not a configuration.nix in the container.

What is the proper way to do this. My goal is to run unstable containers inside of my stable nixos installation

@lucabrunox
Copy link
Contributor

Containers are updated with systemctl reload, did do this? Also please paste any error "does not seem to work" is not helpful.

@mogorman
Copy link
Contributor Author

sorry if i wasn't clear enough. my root NixOS environment is 15.09. I made a container declaratively to run gitlab. It works great. I want to take said container and make it follow the unstable branch instead of the stable branch. My goal is to be able to run nixos-rebuild switch --upgrade and have it upgrade. I also tried to run the nixos-rebuild switch from with in my container this does not work as there is not a /etc/nix/configuration.nix inside of the container because i created it declaratively.

@danbst
Copy link
Contributor

danbst commented Sep 6, 2016

This should be possible after #15967
Also, because of #16959 you can nix-env -iA nixpkgs.nixos-container and recreate the container.

I guess system.defaultChannel = "https://nixos.org/channels/unstable"; doesn't work in containers. Also, see #3021

@mogorman
Copy link
Contributor Author

mogorman commented Sep 6, 2016

That is awesome. I will try to get that running as soon as i can. thank you for update.

@mogorman
Copy link
Contributor Author

mogorman commented Sep 6, 2017

this did fix my issue. sorry didnt close earlier

@mogorman mogorman closed this as completed Sep 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants