mirror of
https://github.com/nickolaj-jepsen/nixos.git
synced 2026-01-23 00:26:48 +01:00
complete rework
This commit is contained in:
parent
d68c699a7a
commit
16813aeef9
89 changed files with 2888 additions and 1658 deletions
34
modules/user.nix
Normal file
34
modules/user.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
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"];
|
||||
initialPassword = "a";
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
useUserPackages = true;
|
||||
useGlobalPkgs = true;
|
||||
};
|
||||
home-manager.users.${cfg.username} = mkAliasDefinitions options.user.home-manager;
|
||||
user.home-manager.home.stateVersion = config.system.stateVersion;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue