From ed990906bd195fe3a703d8243b1c736872d0f055 Mon Sep 17 00:00:00 2001 From: Clover Date: Sun, 15 Jun 2025 22:21:30 +0300 Subject: [PATCH] feat: add option to enable Samba/CIFS features for Nextcloud (#153) same as #152 but minus the formatting from nixfmt Co-authored-by: cl0vrfi3ld <47996003+cl0vrfi3ld@users.noreply.github.com> Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-config/pulls/153 Reviewed-by: Inex Code Co-authored-by: Clover Co-committed-by: Clover --- .gitignore | 1 + sp-modules/nextcloud/module.nix | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/.gitignore b/.gitignore index 6e35230..d584aee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.DS_Store userdata/userdata.json userdata/tokens.json hardware-configuration.nix diff --git a/sp-modules/nextcloud/module.nix b/sp-modules/nextcloud/module.nix index 51f96de..2ac3b1a 100644 --- a/sp-modules/nextcloud/module.nix +++ b/sp-modules/nextcloud/module.nix @@ -88,6 +88,16 @@ in weight = 2; }; }; + enableSambaFeatures = (lib.mkOption { + type = types.bool; + default = false; + description = "Enable support for Samba/CIFS features"; + }) // { + meta = { + type = "bool"; + weight = 3; + }; + }; debug = (lib.mkOption { default = false; type = lib.types.bool; @@ -247,6 +257,13 @@ in }; }; } + # enables samba features when requested + (lib.mkIf cfg.enableSambaFeatures { + # only apply cifs-utils package to this module + services.phpfpm.pools.nextcloud.phpEnv.PATH = + lib.mkForce "${pkgs.samba}/bin:${pkgs.cifs-utils}/bin:/run/wrappers/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/usr/bin:/bin"; + systemd.services.nextcloud-cron.path = [ pkgs.samba pkgs.cifs-utils ]; + }) # the following part is active only when "auth" module is enabled (lib.mkIf is-auth-enabled { systemd.services.nextcloud-setup = {