nixnew/modules/user/default.nix

82 lines
1.7 KiB
Nix
Raw Normal View History

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