# Nextcloud bug/help with workaround

**URL:** https://discourse.nixos.org/t/nextcloud-bug-help-with-workaround/36398
**Category:** Help
**Created:** [December 3, 2023, 2:58pm UTC](https://discourse.nixos.org/t/nextcloud-bug-help-with-workaround/36398 "2023-12-03T14:58:37Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![genson](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/g/e480ec/32.png) [@genson](https://discourse.nixos.org/u/genson)
#### Post date: [December 3, 2023, 2:58pm UTC](https://discourse.nixos.org/t/nextcloud-bug-help-with-workaround/36398/1 "2023-12-03T14:58:37Z")

</div>

NixOS 23.11’s nextcloud-client suffers from [this](https://help.nextcloud.com/t/linux-client-nextcloud-shown-twice-in-nautilus-gnome-files-sidebar-how-can-i-remove-the-double-entry/113991/13). There is an easy work around to comment out a line, but I am not sure how I would do this in NixOS.

The problem is only cosmetic, but I run this on all the computers at my house and my family won’t understand “just cosmetic”.

I appreciate time anyone spends on this.

---

<div class="post-metadata">

### Author: ![\_Andrew](https://discourse.nixos.org/user_avatar/discourse.nixos.org/_andrew/32/10331_2.png) [@\_Andrew](https://discourse.nixos.org/u/_Andrew)
#### Post date: [December 4, 2023, 6:49am UTC](https://discourse.nixos.org/t/nextcloud-bug-help-with-workaround/36398/2 "2023-12-04T06:49:59Z")

</div>

From skimming [the source](https://github.com/nextcloud/desktop/blob/adf8fc77b37e692698cf089a8d0a4988d48545ab/mirall.desktop.in#L200) patching like this should do it:

```nix
nextcloud-client.overrideAttrs (attrs: {
  patches = attrs.patches ++ [
    # Workaround for https://github.com/nextcloud/desktop/issues/6218
    (builtins.toFile "remove-desktop-implements.patch" ''
      --- a/mirall.desktop.in
      +++ b/mirall.desktop.in
      @@ -200 +199,0 @@
      -@LIBCLOUDPROVIDERS_DESKTOP_IMPLEMENTS@
    '')
  ];
})

```

Though maybe someone else can offer a method that doesn’t cause the whole thing to recompile.

Also note that the upstream issue [suggests](https://github.com/nextcloud/desktop/issues/6218#issuecomment-1819479543) that the desktop entry is correct and the .ini is the duplicate, so the more correct patch might be something like:

```diff
--- a/shell_integration/libcloudproviders/CMakeLists.txt
+++ b/shell_integration/libcloudproviders/CMakeLists.txt
@@ -37 +36,0 @@
- libcloudproviders_add_config(org.freedesktop.CloudProviders.ini.in)

```

---

<div class="post-metadata">

### Author: ![genson](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/g/e480ec/32.png) [@genson](https://discourse.nixos.org/u/genson)
#### Post date: [December 5, 2023, 3:34pm UTC](https://discourse.nixos.org/t/nextcloud-bug-help-with-workaround/36398/3 "2023-12-05T15:34:39Z")

</div>

Thank you for the fast response. Unfortunately, I got bogged down in work so I won’t be able to try this until the weekend, but I am looking forward to attempting this fix!

---

<div class="post-metadata">

### Author: ![genson](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/g/e480ec/32.png) [@genson](https://discourse.nixos.org/u/genson)
#### Post date: [December 12, 2023, 9:43pm UTC](https://discourse.nixos.org/t/nextcloud-bug-help-with-workaround/36398/4 "2023-12-12T21:43:13Z")

</div>

Just when I start to feel like I understand nix, I find something which I am pretty sure is elementary to the whole thing that I don’t understand.

I am trying to use your fix from above, but I can’t seem to figure out where to put it.

When I drop it into one my modules, it complains:

```nix

       error: syntax error, unexpected '(', expecting '.' or '='

       at /nix/store/nh03bpiwc21s4i6k0bw7izfihxvdr665-source/systems/workstation-configuration.nix:380:34:

          379|
          380| nextcloud-client.overrideAttrs (attrs: {
             | ^
          381| patches = attrs.patches ++ [

```

Is this supposed to be included within or instead of the

```nix
environment.systemPackages = with pkgs; [
...
nextcloud-client
...
],

```

or as a module of its own, a solitary flake,

---

<div class="post-metadata">

### Author: ![\_Andrew](https://discourse.nixos.org/user_avatar/discourse.nixos.org/_andrew/32/10331_2.png) [@\_Andrew](https://discourse.nixos.org/u/_Andrew)
#### Post date: [December 12, 2023, 10:00pm UTC](https://discourse.nixos.org/t/nextcloud-bug-help-with-workaround/36398/5 "2023-12-12T22:00:48Z")

</div>

You should be able to use it where `nextcloud-client` was, just since that’s in a list delimited by whitespace it needs to be wrapped in parentheses:

```nix
environment.systemPackages = with pkgs; [
  …
  (nextcloud-client.overrideAttrs (attrs: …))
  …
];

```
