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 I create a node for local machine, so it behave just like normal nixos-rebuild switch? #301

Open
amalgame21 opened this issue Nov 13, 2024 · 1 comment

Comments

@amalgame21
Copy link

deploy-rs is great because it can deploy all the remote machine at once.
I want to set it to deploy the local machine because I don't want to open new terminal and run nixos-rebuild switch.
However I can't configure it to also deploy local machine.

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
    deploy-rs.url = "github:serokell/deploy-rs";
  };
  outputs = { self, nixpkgs, deploy-rs, ... } @ inputs: {
    nixosConfigurations = {
      remotelaptop = nixpkgs.lib.nixosSystem {
        # ...
      };
      localdesktop = nixpkgs.lib.nixosSystem {
        # ...
      };
      # ...
    };

    deploy.nodes = {
      "localdesktop" = {
        hostname = "localhost";
        profiles.system = {
          user = "root";
          path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations."localdesktop";
        };
      };
      "remotelaptop" = {
        hostname = "l"; # hostname in ~/.ssh/config
        interactiveSudo = true;
        remoteBuild = false;
        profiles.system = {
          user = "root";
          sshUser = "normaluser";
          path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations."remotelaptop";
        };
      };
    };
    # This is highly advised, and will prevent many possible mistakes
    checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
  };
}

when I run deploy -s -k .#localdesktop -- -v, it shows error because it tries to ssh with localuser@localhost.
How can I disable the ssh functionality?

@sedlund
Copy link

sedlund commented Nov 14, 2024

i use the hostname with ssh. it works fine for local deploy.

Duplicate #99

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