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