infinisil / nixus

Experimental deployment tool supporting multi-host abstractions
GNU General Public License v3.0
194 stars 15 forks source link

Is it possible to deploy a single host? #57

Open busti opened 5 months ago

busti commented 5 months ago

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

infinisil commented 5 months ago

I believe $(nix-build -A myHost) should work because of https://github.com/infinisil/nixus/blob/5257be6a58e6093d0ef7540cee1bf764194e72af/build.nix#L58 :)

busti commented 2 months ago

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

infinisil commented 1 month ago

Taking https://github.com/infinisil/nixus/issues/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 :)