Files
pinpox 612275477a clanServices/users: fix deprecated test name
- fix test name to new format
- regenerate vars via update-vars
2025-10-19 14:52:55 +02:00
..
2025-09-09 19:18:35 +02:00

Usage

{
  inventory.instances = {
    # Deploy user alice on all machines. Don't prompt for password (will be
    # auto-generated).
    user-alice = {
      module = {
        name = "users";
        input = "clan-core";
      };
      roles.default.tags.all = { };
      roles.default.settings = {
        user = "alice";
        prompt = false;
      };
    };

    # Deploy user Carol on all machines. Prompt only once and use the
    # same password on all machines. (`share = true`)
    user-carol = {
      module = {
        name = "users";
        input = "clan";
      };
      roles.default.tags.all = { };
      roles.default.settings = {
        user = "carol";
        share = true;
      };
    };

    # Deploy user bob only on his laptop. Prompt for a password.
    user-bob = {
      module = {
        name = "users";
        input = "clan-core";
      };
      roles.default.machines.bobs-laptop = { };
      roles.default.settings.user = "bob";
    };
  };
}

Migration from root-password module

The deprecated clan.root-password module has been replaced by the users module. Here's how to migrate:

1. Update your flake configuration

Replace the root-password module import with a users service instance:

# OLD - Remove this from your nixosModules:
imports = [
  self.inputs.clan-core.clanModules.root-password
];

# NEW - Add to inventory.instances or machines/flake-module.nix:
instances = {
  users-root = {
    module.name = "users";
    module.input = "clan-core";
    roles.default.tags.nixos = { };
    roles.default.settings = {
      user = "root";
      prompt = false;  # Set to true if you want to be prompted
      groups = [ ];
    };
  };
};

2. Migrate vars

The vars structure has changed from root-password to user-password-root:

# For each machine, rename the vars directories:
cd vars/per-machine/<machine-name>/
mv root-password user-password-root
mv user-password-root/password-hash user-password-root/user-password-hash
mv user-password-root/password user-password-root/user-password