Nextcloud: Difference between revisions

imported>Heartbeast42
mNo edit summary
imported>Alicimo
Missing the license variable in fetchNextcloudApp causes the example to fail. Also expanded the given example to show the use of combining packaged apps with those additionally fetched.
Line 32: Line 32:
   # Instead of using pkgs.nextcloud28Packages.apps,
   # Instead of using pkgs.nextcloud28Packages.apps,
   # we'll reference the package version specified above
   # we'll reference the package version specified above
   extraApps = with config.services.nextcloud.package.packages.apps; {
   extraApps = {
    inherit news contacts calendar tasks;
    inherit (config.services.nextcloud.package.packages.apps) news contacts calendar tasks;
   };
   };
   extraAppsEnable = true;
   extraAppsEnable = true;
Line 41: Line 41:
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 one of the stable Nextcloud versions available in the NixOS repository.
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 one 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.
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, the correct checksum and the license. Additional apps can be found via [https://apps.nextcloud.com Nextcloud app store], while the [https://github.com/helsinki-systems/nc4nix nc4nix] provides an easy reference for the required variables. Note that the declarative specification of apps via this approach requires manual updating of package version (url) and checksum for a new release.


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
Line 48: Line 48:
   [...]
   [...]
   extraApps = {
   extraApps = {
     mail = pkgs.fetchNextcloudApp rec {
     inherit (config.services.nextcloud.package.packages.apps) news contacts calendar tasks;
      url = "https://github.com/nextcloud-releases/mail/releases/download/v1.14.1/mail-v1.14.1.tar.gz";
       memories = pkgs.fetchNextcloudApp {
       sha256 = "sha256-sQUsYC3cco6fj9pF2l1NrCEhA3KJoOvJRhXvBlVpNqo=";
        sha256 = "sha256-Xr1SRSmXo2r8yOGuoMyoXhD0oPVm/0/ISHlmNZpJYsg=";
    };
        url = "https://github.com/pulsejet/memories/releases/download/v6.2.2/memories.tar.gz";
    contacts = pkgs.fetchNextcloudApp rec {
        license = "agpl3";
      url = "https://github.com/nextcloud-releases/contacts/releases/download/v4.2.2/contacts-v4.2.2.tar.gz";
      };
      sha256 = "sha256-eTc51pkg3OdHJB7X4/hD39Ce+9vKzw1nlJ7BhPOzdy0=";
 
    };
   };
   };
   extraAppsEnable = true;
   extraAppsEnable = true;