OneDrive: Difference between revisions

From NixOS Wiki
imported>Mipmip
Add additional information to prevent confussion how this service works.
imported>Nadimkobeissi
m Remove unexplained -0 suffix
Line 14: Line 14:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
onedrive --confdir=$HOME/.config/onedrive-0
onedrive --confdir=$HOME/.config/onedrive
</syntaxhighlight>
</syntaxhighlight>


Line 22: Line 22:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
systemctl --user enable onedrive@onedrive-0.service
systemctl --user enable onedrive@onedrive.service
systemctl --user start onedrive@onedrive-0.service
systemctl --user start onedrive@onedrive.service
</syntaxhighlight>
</syntaxhighlight>


Line 31: Line 31:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
systemctl --user status onedrive@onedrive-0.service
systemctl --user status onedrive@onedrive.service
</syntaxhighlight>
</syntaxhighlight>



Revision as of 12:46, 25 August 2023

OneDrive is Microsoft's cloud file storage service. If you have a OneDrive account, for example from your organization or your Office 365 subscription, NixOS has software to let you sync it to a OneDrive directory your home directory.

Setup

Add the following to your /etc/nixos/configuration.nix:

/etc/nixos/configuration.nix
services.onedrive.enable = true;

and rebuild your system.

Then as the user, run the following:

onedrive --confdir=$HOME/.config/onedrive

You will be given a login URL, open it in your browser, log in to the appropriate Microsoft account to which your OneDrive account is linked to, and after you are logged in, you get an empty screen. This is good, just copy the URL you are redirected to and paste it back in the terminal.

Then run the following:

systemctl --user enable onedrive@onedrive.service
systemctl --user start onedrive@onedrive.service

this will enable and start the systemd user service.

Check that the service started successfully and is running:

systemctl --user status onedrive@onedrive.service

To view the log, run the following:

journalctl --user -t onedrive | less

.

See Also