OneDrive 2.4.25 expects 2.4.23

I expect this is an error:
I have onedrive 2.4.25 but when I execute “systemctl --user status onedrive@onedrive.service”, it’s clear that service is looking to start 2.4.23:

Process: 10616 ExecStart=/nix/store/g2p5whp0kb2q0ks620j9xl7pyq16l1x5-onedrive-2.4.23/bin/onedrive --monitor --confdir=/home/mornar/.config/onedrive (code=exited, status=203/EXEC)

This is due to stale /home/mornar/.config/systemd/user/onedrive@onedrive.service.
Shouldn’t this file be overwritten as part of rebuild?

Well, turns out it’s not created with a rebuild after onedrive is enabled.
Am I missing a step?

The onedrive NixOS module doesn’t create systemd units under $HOME, so you must have made those manually at some point. Additionally, the NixOS module runs a launcher that looks for config under $HOME/.config/onedrive in order to run the various instances.

I suggest blowing away your local unit files and then do systemctl –user daemon-reload followed by systemctl –user start onedrive-launcher.

Thanks, Peter.

I’m sure I did not create the following file. It has references to specific nix store directories - I’m sure it was auto generated.

[Unit]
Description=Onedrive sync service

[Service]
Environment="LOCALE_ARCHIVE=/nix/store/lqkgpf8y30824w3cdkkkffdpd1bkl170-glibc-locales-2.37-45/lib/locale/locale-archive"
Environment="PATH=/nix/store/w8vm09hri2zz7yacryzzzxvsapik4ps4-coreutils-9.1/bin:/nix/store/4cxs4cigh2zdxvma52ygm3mh2igq70iw-findutils-4.9.0/bin:/nix/store/b4in4hmq54h6l34a0v6ha40z97c0lzw2-gnugrep-3.7/bin:/nix/store/4mca20b13q88s6llkr8mc468rh9l9bmr-gnused-4.9/bin:/nix/store/12bynbp6y51j5449l27sy8ycgksd8npk-systemd-253.6/bin:/nix/store/w8vm09hri2zz7yacryzzzxvsapik4ps4-coreutils-9.1/sbin:/nix/store/4cxs4cigh2zdxvma52ygm3mh2igq70iw-findutils-4.9.0/sbin:/nix/store/b4in4hmq54h6l34a0v6ha40z97c0lzw2-gnugrep-3.7/sbin:/nix/store/4mca20b13q88s6llkr8mc468rh9l9bmr-gnused-4.9/sbin:/nix/store/12bynbp6y51j5449l27sy8ycgksd8npk-systemd-253.6/sbin"
Environment="TZDIR=/nix/store/951696yxqlphz378fx126wjnrih08mz3-tzdata-2023c/share/zoneinfo"


ExecStart=/nix/store/4z314afy793q4vm0hvln0ng12skg5hw8-onedrive-2.4.25/bin/onedrive --monitor --confdir=%h/.config/%i

Restart=on-failure
RestartPreventExitStatus=3
RestartSec=3
Type=simple

Also, although onedrive is working, the directories in the [Services] section do not exist (anymore).

What is the right way to recreate this file?

I’m sure I did not create the following file. It has references to specific nix store directories - I’m sure it was auto generated.

Maybe you copied in the generated file in order to test out some adjustments without having to rebuild your configuration every time? I have done that before and also being bitten by the “my manually used file is referencing something old”.

The nixos generated user units all end up under /etc/systemd/user. $HOME/.config/systemd isn’t touched.

What is the right way to recreate this file?

The module should have created the correct file under /etc/systemd/user.

I get it now, thanks!
For some unknown reason, I created the file in $HOME/.config/systemd. I removed it now as I see no use of it.
Then I reloaded the daemon and restarted the launcher.
All seems to work ok now.