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

Is it possible to deploy a single host? #57

Open
busti opened this issue Apr 4, 2024 · 3 comments
Open

Is it possible to deploy a single host? #57

busti opened this issue Apr 4, 2024 · 3 comments

Comments

@busti
Copy link

busti commented Apr 4, 2024

How do I deploy a single host only or alternatively make the deployment not fail when a host cannot be reached?

@busti busti changed the title Deploy a single host Is it possible to deploy a single host? Apr 4, 2024
@infinisil
Copy link
Owner

I believe $(nix-build -A myHost) should work because of

// nixusPkgs.lib.mapAttrs (n: v: v.deployScript) result.config.nodes
:)

@busti
Copy link
Author

busti commented Jun 28, 2024

Could you please also give an example of how to do it with flakes?

@infinisil
Copy link
Owner

Taking #54 as the base, something like

apps =
  {
    default = flake-utils.lib.mkApp {
      drv = self.packages.${system}.deployer;
      exePath = "";
    };
  }
  // nixpkgs.lib.mapAttrs' (name: value: {
    name = "node-${name}";
    value = flake-utils.lib.mkApp {
      drv = value.deployScript;
      exePath = "";
    };
  ) self.packages.${system}.deployer.config.nodes;

should work for nix run .#node-myHost :)

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