nixnew/modules/user/default.nix

46 lines
950 B
Nix
Raw Normal View History

2023-07-26 08:20:41 +00:00
{ self, system, inputs, config, lib, impurity, ... }: let
2023-06-20 04:08:11 +00:00
username = "admin";
homeDirectory = "/home/${username}";
in {
2023-06-21 06:47:58 +00:00
imports = [
inputs.home-manager.nixosModules.home-manager
./general.nix
];
2023-06-20 04:08:11 +00:00
2023-06-22 08:04:50 +00:00
options.main-user = lib.mkOption {
type = lib.types.str;
default = username;
2023-06-20 04:08:11 +00:00
};
config = {
users.users.${username} = {
isNormalUser = true;
uid = 1000;
extraGroups = [ "wheel" ];
initialPassword = "test";
};
2023-06-20 04:08:11 +00:00
home-manager = {
extraSpecialArgs = {
2023-07-26 08:20:41 +00:00
inherit self system inputs impurity;
};
# use system nixpkgs instead of home-manager nixpkgs
useGlobalPkgs = true;
2023-06-20 04:08:11 +00:00
2023-06-22 08:04:50 +00:00
users.${username} = {
home = {
inherit username homeDirectory;
stateVersion = config.system.stateVersion;
};
2023-06-20 04:08:11 +00:00
2023-06-22 08:04:50 +00:00
# enable xdg dir management
xdg.enable = true;
2023-06-26 01:15:34 +00:00
xsession.preferStatusNotifierItems = true;
2023-06-20 04:08:11 +00:00
};
};
};
}