Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accountsservice .face icons/avatars do not work out of the box on NixOS #73976

Open
nh2 opened this issue Nov 23, 2019 · 16 comments
Open

accountsservice .face icons/avatars do not work out of the box on NixOS #73976

nh2 opened this issue Nov 23, 2019 · 16 comments
Labels
6.topic: freedesktop 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: user experience

Comments

@nh2
Copy link
Contributor

nh2 commented Nov 23, 2019

Issue description

I see that on NixOS 19.09 the line Icon=/home/niklas/.face was created by default:

% sudo cat /var/lib/AccountsService/users/niklas
[User]
Session=none+i3
XSession=xfce+i3
Icon=/home/niklas/.face
SystemAccount=false

However, it doesn't load my avatar in the login screen if it put it in ~/.face, because lightdm gets permission denied:

openat(AT_FDCWD, "/home/niklas/.face", O_RDONLY) = -1 EACCES (Permission denied)

This is because lightdm (display-manager.service) runs as the lightdm user and the default permissions of a NixOS home directory are 700, so it can't read any files within.

What can we do to make avatars work as expected in lightdm (and perhaps other display managers)?

@nh2
Copy link
Contributor Author

nh2 commented Nov 23, 2019

Perhaps related: #73976

@worldofpeace
Copy link
Contributor

I don't know why this uses ~/.face as the default. And this will actually be the case with permission denied for every display-manager that uses accountsservice for this (they all run as a separate user). If you do the dbus method call for example,

dbus-send --system --dest=org.freedesktop.Accounts --type=method_call --print-reply=literal /org/freedesktop/Accounts/User1000 org.freedesktop.Accounts.User.SetIconFile string:'/home/worldofpeace/.face'

it internally creates a copy just for accountsservice at /var/lib/AccountsService/icons/worldofpeace, and IconFile property now has this value.

@worldofpeace
Copy link
Contributor

I actually noticed this same issue a few days ago and just did that dbus-send command (even found it in my shell history).

@worldofpeace
Copy link
Contributor

Still not sure why the property stays .face when it should still make a copy of it and use this

I'm betting just setting an IconFile with whatever program will produce the expected behavior.

@worldofpeace worldofpeace changed the title lightdm/accountsservice .face icons/avatars do not work out of the box on NixOS accountsservice .face icons/avatars do not work out of the box on NixOS Nov 24, 2019
@worldofpeace worldofpeace added 6.topic: freedesktop 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: user experience labels Nov 25, 2019
@stale
Copy link

stale bot commented Jun 1, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@nh2
Copy link
Contributor Author

nh2 commented Jun 1, 2020

still important to me

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@stale
Copy link

stale bot commented Nov 28, 2020

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 28, 2020
@nh2
Copy link
Contributor Author

nh2 commented Nov 28, 2020

still important to me

@SeraphyBR
Copy link

Also important

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 1, 2021
@Niols
Copy link
Contributor

Niols commented Nov 4, 2021

Also important

@nova-nowiz
Copy link
Contributor

I have the same issue.
I'm willing to make a pull request but how is this file generated?
Would someone here know who to ping?

@dmedinag
Copy link

still important to me too...

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 19, 2022
@Aproxia-dev
Copy link

Aproxia-dev commented Dec 24, 2022

seems like the easiest way to get user avatars running is by setting users.users.<user>.homeMode to "755"

also in case someone here wants to have declarative avatars then you can simply just use home manager and set home.file.".face".source to a path to an avatar and it should do the trick

it's a workaround, and it's certainly not optimal, but it works great and it's super easily reproducible!

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Dec 24, 2022
@musjj
Copy link
Contributor

musjj commented Aug 1, 2023

A declarative way to handle that dbus-send command would definitely be great. Can this be handled with a NixOS module?

@mobsenpai
Copy link

[Off topic]
Since I stumbled upon it myself. Is there any plans or solutions.

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/setting-the-user-profile-image-under-gnome/36233/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: freedesktop 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: user experience
Projects
None yet
Development

No branches or pull requests

10 participants