Nextcloud: Difference between revisions

imported>Onny
Add link to upstream PR on packaging Nextcloud apps
imported>Onny
Add note on packaged Nextcloud apps
Line 8: Line 8:
services.nextcloud = {                 
services.nextcloud = {                 
   enable = true;                   
   enable = true;                   
   package = pkgs.nextcloud24;
   package = pkgs.nextcloud25;
   hostName = "localhost";
   hostName = "localhost";
   config.adminpassFile = "${pkgs.writeText "adminpass" "test123"}";
   config.adminpassFile = "${pkgs.writeText "adminpass" "test123"}";
Line 22: Line 22:
=== Enable apps ===
=== Enable apps ===


Unfortunately Nextcloud apps are [https://github.com/NixOS/nixpkgs/pull/197373 not yet packaged] in the Nixpkgs repository. It is possibly to install them as usual in the app store of your Nextcloud instance by navigating in the profile menu to the site ''Apps''.
{{Note|Parts of this instruction and module are not yet stable and will be available in the upcoming NixOS 22.11 release.}}


Using the option <code>services.nextcloud.extraApps</code> it is possible to manually add and configure app-packages. In the following example the app ''Mail'' and ''Contacts'' is installed and enabled by default.
[https://github.com/NixOS/nixpkgs/blob/c931a329076796d3644a6bc5b7cc41afc7b3381e/pkgs/servers/nextcloud/packages/nextcloud-apps.json Some apps] which are already packaged on NixOS can be installed directly with the following example configuration


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
Line 30: Line 30:
   enable = true;                   
   enable = true;                   
   [...]
   [...]
   extraApps = [
   package = pkgs.nextcloud25;
  extraApps = with pkgs.nextcloud25Packages.apps; {
    inherit mail, news, contacts
  };
  extraAppsEnable = true
};
</nowiki>}}
 
The apps mail, news and contacts will be installed and enabled in your instance automatically. Note that the Nextcloud version specified in <code>package</code> and <code>extraApps</code> need to match on of the stable Nextcloud versions available in the NixOS repository.
 
To manually fetch and install packages, you need to add them via the helper script <code>fetchNextcloudApp</code> by specifing the release tarball as url and the correct checksum. Both are available for example in the official [https://apps.nextcloud.com Nextcloud app store]. Note that in this case the app package version and checksum has to be updated manually in case there is a new release.
 
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
services.nextcloud = {               
  enable = true;                 
  [...]
  extraApps = {
     mail = pkgs.fetchNextcloudApp rec {
     mail = pkgs.fetchNextcloudApp rec {
       url = "https://github.com/nextcloud-releases/mail/releases/download/v1.14.1/mail-v1.14.1.tar.gz";
       url = "https://github.com/nextcloud-releases/mail/releases/download/v1.14.1/mail-v1.14.1.tar.gz";
Line 39: Line 55:
       sha256 = "sha256-eTc51pkg3OdHJB7X4/hD39Ce+9vKzw1nlJ7BhPOzdy0=";
       sha256 = "sha256-eTc51pkg3OdHJB7X4/hD39Ce+9vKzw1nlJ7BhPOzdy0=";
     };
     };
   ];
   };
   extraAppsEnable = true
   extraAppsEnable = true
};
};
</nowiki>}}
</nowiki>}}


Using this method you'll have to manually add the most recent release tarball from the [https://apps.nextcloud.com Nextcloud app store] and update the checksums.
Alternatively apps can be manually installed via the app store integrated in your Nextcloud instance by navigating in the profile menu to the site "Apps".


== Maintenance ==
== Maintenance ==