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 figure out how to use some overlays when deploying to nix-on-droid with deploy-rs #92

Closed
bbigras opened this issue May 29, 2021 · 3 comments

Comments

@bbigras
Copy link

bbigras commented May 29, 2021

I'm using something like this to deploy to nix-on-droid with deploy-rs, but I can't figure out how to add some overlays.

I would guess that in my case, deploy-rs is just deploying the profile that I'm building myself, so maybe it has nothing to do with deploy-rs.

let
pixel2 = (inputs.nix-on-droid.lib.aarch64-linux.nix-on-droid { config = ../hosts/pixel2; }).activationPackage;
in
{
{
  deploy = {
    autoRollback = true;
    magicRollback = true;
    user = "root";

    nodes = [
    {
      pixel2 = {
        hostname = "pixel2";

        # to prevent using sudo
        sshUser = "nix-on-droid";
        user = "nix-on-droid";

        profiles.nix-on-droid.path = deploy-rs.lib.aarch64-linux.activate.custom
          pixel2
          (pixel2 + "/activate");
      };
    };
];
  };
}

nix-community/nix-on-droid#94 (comment)

@notgne2
Copy link
Contributor

notgne2 commented Jun 6, 2021

I think the problem here is with the flake.nix in nix-on-droid, it passes pkgs
which is just nixpkgs.legacyPackages.${system}, and has seemingly no way to override it, in my opinion it might make more sense to have pkgs = import nixpkgs { inherit system; overlays = self.overlays; }; instead, then in the deploy-rs configuration you wouldn't need to change anything. Alternatively, you could make it take pkgs as an argument and pass that from your deploy-rs configuration.

note: the example I gave won't work because self.overlays won't exist, you should move it to not be under flake-utils.lib.eachSystem, see the output schema on https://nixos.wiki/wiki/Flakes

@notgne2
Copy link
Contributor

notgne2 commented Jun 6, 2021

Also in other activations including those built-in to deploy-rs, we would do $PROFILE/activate instead, I don't think that's going to change anything in your case though

@bbigras
Copy link
Author

bbigras commented Jun 21, 2021

Thanks. I think I was able to fix it with nix-community/nix-on-droid@df4173c

@bbigras bbigras closed this as completed Jun 21, 2021
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