2023-12-20 04:07:35 +00:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
let
|
2024-05-09 16:34:04 +00:00
|
|
|
inherit (lib) escapeShellArg mapAttrs' nameValuePair;
|
2023-12-20 04:07:35 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
# Pending https://github.com/NixOS/nixpkgs/issues/163080
|
|
|
|
system.activationScripts = mapAttrs'
|
|
|
|
(name: user: nameValuePair "accounts-service-icon-${name}" {
|
|
|
|
text = ''
|
2024-05-09 16:34:04 +00:00
|
|
|
face="$(getent passwd ${escapeShellArg user.name} | cut -d: -f6)/.face"
|
2023-12-20 04:07:35 +00:00
|
|
|
|
|
|
|
if [[ -f "$face" ]]; then
|
2024-05-09 16:34:04 +00:00
|
|
|
cp --reflink=auto --update --verbose "$face" '/var/lib/AccountsService/icons/'${escapeShellArg user.name}
|
2023-12-20 04:07:35 +00:00
|
|
|
fi
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
config.users.users;
|
|
|
|
}
|