nixnew/modules/user/default.nix

46 lines
939 B
Nix

{ system, inputs, config, lib, impurity, ... }: let
username = "admin";
homeDirectory = "/home/${username}";
in {
imports = [
inputs.home-manager.nixosModules.home-manager
./general.nix
];
options.main-user = lib.mkOption {
type = lib.types.str;
default = username;
};
config = {
users.users.${username} = {
isNormalUser = true;
uid = 1000;
extraGroups = [ "wheel" ];
initialPassword = "test";
};
home-manager = {
extraSpecialArgs = {
inherit system inputs impurity;
};
# use system nixpkgs instead of home-manager nixpkgs
useGlobalPkgs = true;
users.${username} = {
home = {
inherit username homeDirectory;
stateVersion = config.system.stateVersion;
};
# enable xdg dir management
xdg.enable = true;
xsession.preferStatusNotifierItems = true;
};
};
};
}