nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
6.57k stars 1.73k forks source link

bug: Profile-sync-daemon not working correctly #5454

Open TheStachelfisch opened 3 months ago

TheStachelfisch commented 3 months ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

Currently the newly-added services.psd.enable option doesn't work correctly due to three issues.

First issue, the psd daemon will not work, since the base config files in $HOME/.config/psd are not created, the daemon will always exit with:

First time running psd so please edit /home/USER/.config/psd/psd.conf to your liking and run again.

Second issue, if you manually add the config file, it always fails with:

profile-sync-daemon[6398]:   is not a supported browser. Check config file for typos: /home/USER/.config/psd/psd.conf

I generated the config file simply by running psd once. This might be be a bug in psd, since if no browsers are added to the config, it should automatically manage all browsers present on the system.

Third issue, if you manually add a browser to the config, it fails, since the script PSD runs can't find needed commands in the environment.

/nix/store/nycg6pa28kh4hk1nmm6vh73gvd758vav-profile-sync-daemon-6.50/share/psd/browsers/firefox: line 15: grep: command not found
/nix/store/nycg6pa28kh4hk1nmm6vh73gvd758vav-profile-sync-daemon-6.50/share/psd/browsers/firefox: line 15: sed: command not found
/nix/store/nycg6pa28kh4hk1nmm6vh73gvd758vav-profile-sync-daemon-6.50/bin/profile-sync-daemon: line 390: id: command not found

Maintainer CC

@danjujan @rycee

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.9.1, NixOS, 24.11 (Vicuña), 24.11.20240523.3305b2b`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/store/3qi6zkjzggmilf1sx4b979ym6fxnqsjl-source`
danjujan commented 3 months ago

Thank you for the report! Does https://github.com/danjujan/home-manager/commit/0d0b3333f8ed55db1a9984d4bf166663d19f1ddc fix your third issue?

Currently the psd.conf is not managed by home-manager as I simply ported the NixOS module. Support for that is on my todo list. However, I don't have much time in the coming weeks. Maybe you can create a PR for that?

TheStachelfisch commented 3 months ago

Thank you for the report! Does danjujan@0d0b333 fix your third issue?

Currently the psd.conf is not managed by home-manager as I simply ported the NixOS module. Support for that is on my todo list. However, I don't have much time in the coming weeks. Maybe you can create a PR for that?

Sorry for the late reply, unfortunately it doesn't fix the issue. Correction: It indeed fixed the issue, I didn't see that it was on your fork 🤦 I'll look into the other issues myself later this week and create a PR to fix it.

danjujan commented 3 months ago

I'll look into the other issues myself later this week and create a PR to fix it.

Have a look at nixos/modules/services/desktops/profile-sync-daemon.nix before https://github.com/NixOS/nixpkgs/commit/574f4c406915ce71ec66ea2ce7c1466f72d6c0ae. Most of the functionality was apparently there already but got removed.

Zweihander-Main commented 2 months ago

Same issue here and also fixed by the same patch -- https://github.com/danjujan/home-manager/commit/0d0b3333f8ed55db1a9984d4bf166663d19f1ddc

FYI -- also added findutils into the envPath binary list in that patch. The psd-resync service gave me a complaint about missing find without it.