Thicket data repository for the EEG
at main 6.8 kB view raw
1{ 2 "id": "https://mort.io/blog/nixos-onedrive/", 3 "title": "OneDrive and NixOS", 4 "link": "https://mort.io/blog/nixos-onedrive/", 5 "updated": "2023-08-22T00:00:00", 6 "published": "2023-08-22T00:00:00", 7 "summary": "<p>Starting by reading instructions at:</p>\n<ul>\n<li><a href=\"https://github.com/abraunegg/onedrive/blob/master/docs/sharepoint-libraries.md\">https://github.com/abraunegg/onedrive/blob/master/docs/sharepoint-libraries.md</a></li>\n<li><a href=\"https://github.com/abraunegg/onedrive/blob/master/docs/business-shared-items.md\">https://github.com/abraunegg/onedrive/blob/master/docs/business-shared-items.md</a></li>\n<li><a href=\"https://github.com/NixOS/nixpkgs/pull/77734#issuecomment-575874225\">https://github.com/NixOS/nixpkgs/pull/77734#issuecomment-575874225</a></li>\n</ul>\n<p>FWIW I also use that package on a NixOS system (via a Nix package that can presumably be installed on other systems if you add nix as a package manager), <a href=\"https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/networking/onedrive.nix\">https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/networking/onedrive.nix</a>.</p>\n<p>I have successfully used it with the University and my startup’s tenancies (both personal OneDrive and enterprise Sharepoint sites) simultaneously – this was fairly simple in the end but I recall it took a while to do the token dance to get the necessary tokens, and then to get all the runes right. In short it was something like:</p>\n<ol>\n<li>\n<p>Follow the instructions Robert pointed to sort out access to the various accounts, refresh tokens, and the like.</p>\n</li>\n<li>\n<p>Create file <code>~/.config/onedrive-launcher</code> comprising each subdirectory of <code>~/.config</code> that is a onedrive configuration directory corresponding to each account – I named these after the accounts in question so mine contained</p>\n</li>\n</ol>\n<pre><code><span>onedrive-rmm1002@cam.ac.uk\n</span><span>onedrive-mort@ikva.ai\n</span><span>sharepoint-mort@ikva.ai-iKVALimited\n</span></code></pre>\n<p>(I now prefix the last two lines with <code># </code> to comment them out as I don’t need those synced any more.)</p>\n<p>The systemd service <code>onedrive-launcher.service</code> then uses the file to kick off a systemd <code>onedrive@...</code> service for each entry.</p>\n<ol>\n<li>Edit the <code>~/.config/ACCOUNT/config</code> files appropriately; the only changes I made were to</li>\n</ol>\n<pre><code><span><span><span># for my University account\n</span></span></span><span><span><span>sync_dir</span> <span>=</span></span> <span>&quot;~/OneDrive/rmm1002@cam.ac.uk&quot;</span>\n</span><span>\n</span><span><span><span># for my startup personal OneDrive\n</span></span></span><span><span><span>sync_dir</span> <span>=</span></span> <span>&quot;~/OneDrive/mort@ikva.ai&quot;</span>\n</span><span><span><span>sync_business_shared_folders</span> <span>=</span></span> <span>&quot;true&quot;</span>\n</span><span>\n</span><span><span><span># for startup Sharepoint sites\n</span></span></span><span><span><span>sync_dir</span> <span>=</span></span> <span>&quot;~/OneDrive/mort@ikva.ai-iKVA_Limited&quot;</span>\n</span><span><span><span>drive_id</span> <span>=</span></span> <span>&quot;...&quot;</span><span> <span># rune found per instructions Robert pointed to I think\n</span></span></span></code></pre>", 8 "content": "<p>Starting by reading instructions at:</p>\n<ul>\n<li><a href=\"https://github.com/abraunegg/onedrive/blob/master/docs/sharepoint-libraries.md\">https://github.com/abraunegg/onedrive/blob/master/docs/sharepoint-libraries.md</a></li>\n<li><a href=\"https://github.com/abraunegg/onedrive/blob/master/docs/business-shared-items.md\">https://github.com/abraunegg/onedrive/blob/master/docs/business-shared-items.md</a></li>\n<li><a href=\"https://github.com/NixOS/nixpkgs/pull/77734#issuecomment-575874225\">https://github.com/NixOS/nixpkgs/pull/77734#issuecomment-575874225</a></li>\n</ul>\n<p>FWIW I also use that package on a NixOS system (via a Nix package that can presumably be installed on other systems if you add nix as a package manager), <a href=\"https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/networking/onedrive.nix\">https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/networking/onedrive.nix</a>.</p>\n<p>I have successfully used it with the University and my startup’s tenancies (both personal OneDrive and enterprise Sharepoint sites) simultaneously – this was fairly simple in the end but I recall it took a while to do the token dance to get the necessary tokens, and then to get all the runes right. In short it was something like:</p>\n<ol>\n<li>\n<p>Follow the instructions Robert pointed to sort out access to the various accounts, refresh tokens, and the like.</p>\n</li>\n<li>\n<p>Create file <code>~/.config/onedrive-launcher</code> comprising each subdirectory of <code>~/.config</code> that is a onedrive configuration directory corresponding to each account – I named these after the accounts in question so mine contained</p>\n</li>\n</ol>\n<pre><code><span>onedrive-rmm1002@cam.ac.uk\n</span><span>onedrive-mort@ikva.ai\n</span><span>sharepoint-mort@ikva.ai-iKVALimited\n</span></code></pre>\n<p>(I now prefix the last two lines with <code># </code> to comment them out as I don’t need those synced any more.)</p>\n<p>The systemd service <code>onedrive-launcher.service</code> then uses the file to kick off a systemd <code>onedrive@...</code> service for each entry.</p>\n<ol>\n<li>Edit the <code>~/.config/ACCOUNT/config</code> files appropriately; the only changes I made were to</li>\n</ol>\n<pre><code><span><span><span># for my University account\n</span></span></span><span><span><span>sync_dir</span> <span>=</span></span> <span>&quot;~/OneDrive/rmm1002@cam.ac.uk&quot;</span>\n</span><span>\n</span><span><span><span># for my startup personal OneDrive\n</span></span></span><span><span><span>sync_dir</span> <span>=</span></span> <span>&quot;~/OneDrive/mort@ikva.ai&quot;</span>\n</span><span><span><span>sync_business_shared_folders</span> <span>=</span></span> <span>&quot;true&quot;</span>\n</span><span>\n</span><span><span><span># for startup Sharepoint sites\n</span></span></span><span><span><span>sync_dir</span> <span>=</span></span> <span>&quot;~/OneDrive/mort@ikva.ai-iKVA_Limited&quot;</span>\n</span><span><span><span>drive_id</span> <span>=</span></span> <span>&quot;...&quot;</span><span> <span># rune found per instructions Robert pointed to I think\n</span></span></span></code></pre>", 9 "content_type": "html", 10 "author": { 11 "name": "Unknown", 12 "email": null, 13 "uri": null 14 }, 15 "categories": [], 16 "source": "https://mort.io/atom.xml" 17}