Skip to content

Can I create a node for local machine, so it behave just like normal nixos-rebuild switch? #301

Open
@amalgame21

Description

@amalgame21

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions