bro ion even no

This commit is contained in:
strix 2026-08-25 14:00:05 +02:00
parent 69a92fdd5e
commit ed13a64d87
9 changed files with 215 additions and 22 deletions

33
util/profile-icons.nix Normal file
View file

@ -0,0 +1,33 @@
{ lib, config, ...}:
let
userOptions = with lib; {
options.icon = mkOption { type = types.nullOr types.path; default = null; };
};
mkGdmUserConf = icon: ''
[User]
Session=
XSession=
Icon=${icon}
SystemAccount=false
'';
userList = with lib; filter (entry: entry.icon != null) (mapAttrsToList (name: value: { inherit name; icon = value.icon; }) config.users.users);
mkBootCommand = entry: "echo -e '${mkGdmUserConf entry.icon}' > /var/lib/AccountsService/users/${entry.name}\n";
bootCommands = map mkBootCommand userList;
in
{
options = {
users.users = with lib; with types; mkOption {
type = attrsOf (submodule userOptions);
};
};
config = lib.mkIf config.services.xserver.displayManager.gdm.enable {
boot.postBootCommands = with lib; strings.concatStrings bootCommands;
};
}