Allow access to the main home manager user directly

This commit is contained in:
outfoxxed 2023-06-19 22:51:29 -07:00
parent 9b4ec6e0a1
commit 45ab2f83aa
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E

View file

@ -1,67 +1,80 @@
{ system, inputs, config, pkgs, ... }: let
{ system, inputs, config, lib, pkgs, ... }: let
username = "admin";
homeDirectory = "/home/${username}";
in {
imports = [ inputs.home-manager.nixosModules.home-manager ];
users.users.${username} = {
isNormalUser = true;
uid = 1000;
extraGroups = [ "wheel" ];
initialPassword = "test";
options.user = lib.mkOption {
type = with lib.types; attrsOf anything;
default = {};
};
fonts = {
enableDefaultFonts = false;
config = {
users.users.${username} = {
isNormalUser = true;
uid = 1000;
extraGroups = [ "wheel" ];
initialPassword = "test";
};
fonts = with inputs.stable.legacyPackages.${system}; [
dejavu_fonts
nerdfonts
noto-fonts
noto-fonts-cjk
];
};
fonts = {
enableDefaultFonts = false;
systemd = {
# kde polkit agent
user.services.polkit-agent = {
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
fonts = with inputs.stable.legacyPackages.${system}; [
dejavu_fonts
nerdfonts
noto-fonts
noto-fonts-cjk
];
};
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
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";
};
programs.hyprland.enable = true;
home-manager = {
extraSpecialArgs = {
inherit system inputs;
systemConfig = config;
programs.gnupg.agent = {
enable = true;
pinentryFlavor = "gnome3";
};
# use system nixpkgs instead of home-manager nixpkgs
useGlobalPkgs = true;
environment.variables = {
XCURSOR_SIZE = "24";
};
users.${username} = { system, inputs, systemConfig, pkgs, ... }: {
programs.hyprland.enable = true;
home-manager = {
extraSpecialArgs = {
inherit system inputs;
};
# use system nixpkgs instead of home-manager nixpkgs
useGlobalPkgs = true;
users.${username} = config.user;
};
# pass the user config as a system module argument
_module.args = {
homeConfig = config.home-manager.users.${username};
};
user = {
home = {
inherit username homeDirectory;
stateVersion = systemConfig.system.stateVersion;
stateVersion = config.system.stateVersion;
};
};
};