17 withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
20 stdenv.mkDerivation (finalAttrs: {
24 src = fetchFromGitHub {
27 rev = "v${finalAttrs.version}";
28 hash = "sha256-Lek1tW0alQQvlOHpz//M/y4iJY3PWRkcmXGLwjCLozk=";
32 # remove when updating to v2.5.4
34 name = "fix-openssl-version-check-error.patch";
35 url = "https://github.com/abraunegg/onedrive/commit/d956318b184dc119d65d7a230154df4097171a6d.patch";
36 hash = "sha256-LGmKqYgFpG4MPFrHXqvlDp7Cxe3cEGYeXXH9pCXtGkU=";
57 ] ++ lib.optionals withSystemd [ systemd ];
60 (lib.enableFeature true "notifications")
61 (lib.withFeatureAs withSystemd "systemdsystemunitdir" "${placeholder "out"}/lib/systemd/system")
62 (lib.withFeatureAs withSystemd "systemduserunitdir" "${placeholder "out"}/lib/systemd/user")
65 # we could also pass --enable-completions to configure but we would then have to
66 # figure out the paths manually and pass those along.
68 installShellCompletion --bash --name onedrive contrib/completions/complete.bash
69 installShellCompletion --fish --name onedrive contrib/completions/complete.fish
70 installShellCompletion --zsh --name _onedrive contrib/completions/complete.zsh
72 substituteInPlace $out/lib/systemd/user/onedrive.service --replace-fail "/usr/bin/sleep" "${coreutils}/bin/sleep"
73 substituteInPlace $out/lib/systemd/system/onedrive@.service --replace-fail "/usr/bin/sleep" "${coreutils}/bin/sleep"
77 tests.version = testers.testVersion {
78 package = finalAttrs.finalPackage;
79 version = "v${finalAttrs.version}";
84 homepage = "https://github.com/abraunegg/onedrive";
85 description = "Complete tool to interact with OneDrive on Linux";
86 license = lib.licenses.gpl3Only;
87 mainProgram = "onedrive";
88 maintainers = with lib.maintainers; [
93 platforms = lib.platforms.linux;