nixnew/modules/user/default.nix
2023-06-25 18:29:27 -07:00

82 lines
1.7 KiB
Nix

{ system, inputs, config, lib, pkgs, 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";
};
fonts = {
enableDefaultFonts = false;
fonts = with inputs.stable.legacyPackages.${system}; [
dejavu_fonts
nerdfonts
noto-fonts
noto-fonts-cjk
];
};
systemd = {
# kde polkit agent
user.services.polkit-agent = {
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
};
programs.gnupg.agent = {
enable = true;
pinentryFlavor = "gnome3";
};
environment.variables = {
XCURSOR_SIZE = "24";
};
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;
};
};
};
}