mirror of
https://github.com/nickolaj-jepsen/nixos.git
synced 2026-01-22 08:06:50 +01:00
34 lines
746 B
Nix
34 lines
746 B
Nix
{
|
|
config,
|
|
lib,
|
|
options,
|
|
...
|
|
}:
|
|
with lib; let
|
|
cfg = config.user;
|
|
in {
|
|
options.user = {
|
|
username = mkOption {
|
|
type = types.str;
|
|
description = "The username of the user";
|
|
};
|
|
home-manager = mkOption {
|
|
type = options.home-manager.users.type.functor.wrapped;
|
|
};
|
|
};
|
|
|
|
config = {
|
|
users.users.${cfg.username} = {
|
|
isNormalUser = true;
|
|
extraGroups = ["wheel"];
|
|
hashedPasswordFile = config.age.secrets.hashed-user-password.path;
|
|
};
|
|
|
|
home-manager = {
|
|
useUserPackages = true;
|
|
useGlobalPkgs = true;
|
|
};
|
|
home-manager.users.${cfg.username} = mkAliasDefinitions options.user.home-manager;
|
|
user.home-manager.home.stateVersion = config.system.stateVersion;
|
|
};
|
|
}
|