2023-07-08 14:27:43 +00:00
---
title: Declarative user management
---
= Declarative user management
2023-12-05 02:42:02 +00:00
Similarly to xref:../02-declarative-host-management/index.adoc[Declarative host management], this project also provides a way to declare home-manager users.
2023-07-08 14:27:43 +00:00
The `users.toml` sits in the project root expecting certain data.
Similar to `images.toml`, it expects a table of users with each representing one of the users from github:{github-repo}[`./users/home-manager/`, path=./users/home-manager/, rev=master].
These are then included as part of `homeConfigurations` for easier installation with the standalone home-manager tool.
Of which they are then included as part of deploy nodes for deploy-rs (also for easier deployment).
Here's an example user with complete schema.
.A user with complete schema
[source, toml]
----
[foo-dogsquared]
2023-08-01 05:32:27 +00:00
systems = [ "x86_64-linux" ]
2023-08-02 15:00:09 +00:00
nixpkgs-channel = "nixos-stable"
2023-07-08 14:27:43 +00:00
home-manager-channel = "home-manager-23.05"
home-directory = "/home/foo-dogsquared"
username = "foodogsquared"
[foo-dogsquared.deploy]
hostname = "local.foodogsquared.one"
ssh-user = "admin"
profile = "foodogsquared"
fast-connection = true
auto-rollback = true
magic-rollback = true
remote-build = true
----
2023-08-01 05:32:27 +00:00
- `systems` contains a list of platforms of the home-manager user.
2023-07-08 14:27:43 +00:00
This is mainly used to indicate the platform used for the nixpkgs repository.
2023-08-02 15:00:09 +00:00
- `nixpkgs-channel` indicates the branch of the nixpkgs to be used.
By default, this uses the `nixpkgs` which follows the `nixos-unstable` branch.
2023-07-08 14:27:43 +00:00
- `home-manager-channel` contains the home-manager channel to be used.
The value should be one of the home-manager channel that is imported into this flake.
By default, it sets the home-manager channel at `home-manager` which is pointed at the unstable channel.
- `home-directory` is the associated home directory of the home-manager.
It is set for `config.home.directory` at the home-manager configuration.
By default, it will be set at `/home/$USERNAME`.
- `username` is the username of the home-manager user to be used for `config.home.username` at the home-manager configuration.
If unset, it will use the table key.
In the above example, the unset value would be `foo-dogsquared`.
- `deploy` is pretty similar to the previous configuration setting that it sets certain options for deploy-rs.