@ -95,6 +95,50 @@ in {
'' ;
example = " / m n t / n e x t c l o u d - f i l e " ;
} ;
extraApps = mkOption {
type = types . attrsOf types . package ;
default = { } ;
description = ''
Extra apps to install . Should be an attrSet of appid to packages generated by fetchNextcloudApp .
The appid must be identical to the " i d " value in the apps appinfo/info.xml.
Using this will disable the appstore to prevent Nextcloud from updating these apps ( see < xref linkend = " o p t - s e r v i c e s . n e x t c l o u d . a p p s t o r e E n a b l e " / > ) .
'' ;
example = literalExample ''
{
maps = pkgs . fetchNextcloudApp {
name = " m a p s " ;
sha256 = " 0 0 7 y 8 0 i d q g 6 b 6 z k 6 k j x g 4 v g w 0 z 8 f s x s 9 l a j n v 4 9 v v 1 z j y 6 j x 2 i 1 i + u s e T h e L a t e s t V e r s i o n " ;
url = " h t t p s : / / g i t h u b . c o m / n e x t c l o u d / m a p s / r e l e a s e s / d o w n l o a d / v 0 . 1 . 9 / m a p s - 0 . 1 . 9 . t a r . g z " ;
version = " 0 . 1 . 9 " ;
} ;
phonetrack = pkgs . fetchNextcloudApp {
name = " p h o n e t r a c k " ;
sha256 = " 0 q f 3 6 6 v b a h y l 2 7 p 9 m s h f m a 1 a s 4 n v q l 6 w 7 5 z y 2 z k 5 x w w b p 3 4 3 v s b c + b r e a k S h a " ;
url = " h t t p s : / / g i t l a b . c o m / e n e i l u j / p h o n e t r a c k - o c / - / w i k i s / u p l o a d s / 9 3 1 a a a f 8 d c a 2 4 b f 3 1 a 7 e 1 6 9 a 8 3 c 1 7 2 3 5 / p h o n e t r a c k - 0 . 6 . 9 . t a r . g z " ;
version = " 0 . 6 . 9 " ;
} ;
}
'' ;
} ;
extraAppsEnable = mkOption {
type = types . bool ;
default = true ;
description = ''
Automatically enable the apps in < xref linkend = " o p t - s e r v i c e s . n e x t c l o u d . e x t r a A p p s " / > every time nextcloud starts .
If set to false , apps need to be enabled in the Nextcloud user interface or with nextcloud-occ app:enable.
'' ;
} ;
appstoreEnable = mkOption {
type = types . nullOr types . bool ;
default = null ;
example = true ;
description = ''
Allow the installation of apps and app updates from the store .
Enabled by default unless there are packages in < xref linkend = " o p t - s e r v i c e s . n e x t c l o u d . e x t r a A p p s " / > .
Set to true to force enable the store even if < xref linkend = " o p t - s e r v i c e s . n e x t c l o u d . e x t r a A p p s " / > is used .
Set to false to disable the installation of apps from the global appstore . App management is always enabled regardless of this setting .
'' ;
} ;
logLevel = mkOption {
type = types . ints . between 0 4 ;
default = 2 ;
@ -591,9 +635,15 @@ in {
'' }
$ CONFIG = [
' apps_paths' = > [
$ { optionalString ( cfg . extraApps != { } ) " [ ' p a t h ' = > ' ${ cfg . home } / n i x - a p p s ' , ' u r l ' = > ' / n i x - a p p s ' , ' w r i t a b l e ' = > f a l s e ] , " }
[ ' path' = > ' $ { cfg . home } /apps ' , ' url' = > ' /apps ' , ' writable' = > false ] ,
[ ' path' = > ' $ { cfg . home } /store-apps ' , ' url' = > ' /store-apps ' , ' writable' = > true ] ,
] ,
$ { if ( cfg . appstoreEnable != null )
then '' ' a p p s t o r e e n a b l e d ' = > ${ lib . boolToString cfg . appstoreEnable } , ''
else ( if ( cfg . extraApps != { } )
then '' ' a p p s t o r e e n a b l e d ' = > f a l s e , ''
else " " ) }
' datadirectory' = > ' $ { datadir } /data ' ,
' skeletondirectory' = > ' $ { cfg . skeletonDirectory } ' ,
$ { optionalString cfg . caching . apcu " ' m e m c a c h e . l o c a l ' = > ' \\ O C \\ M e m c a c h e \\ A P C u ' , " }
@ -679,10 +729,14 @@ in {
fi
ln - sf $ { cfg . package } /apps $ { cfg . home } /
rm - rf $ { cfg . home } /nix-apps
#Install extra apps
ln - sfT $ { pkgs . linkFarm " n i x - a p p s " ( lib . mapAttrsToList ( name : target : { name = name ; path = target ; } ) cfg . extraApps ) } $ { cfg . home } /nix-apps
# create nextcloud directories.
# if the directories exist already with wrong permissions, we fix that
for dir in $ { datadir } /config $ { datadir } /data $ { cfg . home } /store-apps ; do
for dir in $ { datadir } /config $ { datadir } /data $ { cfg . home } /store-apps $ { cfg . home } /nix-apps ; do
if [ ! - e $ dir ] ; then
install - o nextcloud - g nextcloud - d $ dir
elif [ $ ( stat - c " % G " $ dir ) != " n e x t c l o u d " ] ; then
@ -781,6 +835,10 @@ in {
priority = 201 ;
extraConfig = " r o o t ${ cfg . home } ; " ;
} ;
" ~ ^ / n i x - a p p s " = {
priority = 201 ;
extraConfig = " r o o t ${ cfg . home } ; " ;
} ;
" ^ ~ / . w e l l - k n o w n " = {
priority = 210 ;
extraConfig = ''