2023-07-08 14:27:43 +00:00
---
title: Declarative user management
---
= Declarative user management
2023-12-18 10:03:18 +00:00
Similarly to xref:../01-declarative-host-management/index.adoc[Declarative host management], this project also provides a way to declare home-manager users.
2024-01-16 12:07:58 +00:00
This is also presented as a custom flake-parts module as well, ready to be configured at `setups.home-manager` namespace of the flake-parts config.
This module is a bit simpler that it only makes configured users to be added to `homeConfigurations` and `deploy.nodes`.
2023-07-08 14:27:43 +00:00
Here's an example user with complete schema.
.A user with complete schema
2023-12-23 12:32:08 +00:00
[source, nix]
2023-07-08 14:27:43 +00:00
----
2023-12-23 12:32:08 +00:00
{
2024-01-16 12:07:58 +00:00
setups.home-manager.sharedModules = [
inputs.your-mom.homeModules.default
];
# Here is the meat, what you're likely going to do.
setups.home-manager.configs.foo-dogsquared = {
systems = [ "x86_64-linux" "aarch64-linux" ];
2024-01-20 09:24:26 +00:00
nixpkgsBranch = "nixos-stable";
homeManagerBranch = "home-manager-23.05";
homeDirectory = "/home/foo-dogsquared";
2023-12-23 12:32:08 +00:00
username = "foodogsquared";
modules = [
({ config, lib, ... }: {
services.foo.enable = true;
})
];
2024-01-16 12:07:58 +00:00
overlays = [
inputs.neovim-nightly-overlay.overlays.default
];
2023-12-23 12:32:08 +00:00
deploy = {
hostname = "local.foodogsquared.one";
2024-01-16 12:07:58 +00:00
fastConnection = true;
autoRollback = true;
magicRollback = true;
remoteBuild = true;
2023-12-23 12:32:08 +00:00
};
};
}
2023-07-08 14:27:43 +00:00
----