Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/nextcloud: add extraConfig #103323

Closed

Conversation

ajs124
Copy link
Member

@ajs124 ajs124 commented Nov 10, 2020

Motivation for this change

Fixes #103320 cc @nivadis

I had this laying around, but never got around to upstreaming it.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@@ -420,6 +428,7 @@ in {
'dbtype' => '${c.dbtype}',
'trusted_domains' => ${writePhpArrary ([ cfg.hostName ] ++ c.extraTrustedDomains)},
'trusted_proxies' => ${writePhpArrary (c.trustedProxies)},
${optionalString (c.extraConfig != null) c.extraConfig}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would make sense to leave an example in the option, otherwise a developer would have to read the module's code to know how to use this.

description = ''
Extra text to append to nextcloud override config options.
'';
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if a settings option as described in NixOS/rfcs#42 would make sense here: otherwise people would accidentally override things, with such an approach, override and merging could be implemented in a better way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not the most fun thing to do... but I agree settings would be a much better idea. See

return json_decode('${builtins.toJSON cfg.config}', true);
for the least insane approach several people could come up with.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if you need to code a function inside config.php? it's an executable file for a reason probably, even though I'm not a Nextcloud pro

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am using Nextcloud for a while now and newer saw this use case.

@vikanezrimaya
Copy link
Member

vikanezrimaya commented Nov 24, 2020 via email

@SuperSandro2000
Copy link
Member

I am using Nextcloud for a while now and newer saw this use case.
user_external requires config modifications. I would love to do them declaratively.

Do you require them to be dynamic? Otherwise you could generate them with the help of nix.

@vikanezrimaya
Copy link
Member

vikanezrimaya commented Nov 25, 2020 via email

@ajs124
Copy link
Member Author

ajs124 commented Jan 14, 2021

I'm not gonna implement any of the suggestions here, so if anyone wants this, just open a new PR.

@ajs124 ajs124 closed this Jan 14, 2021
@ajs124 ajs124 deleted the feat/nextcloud-extraConfig branch January 14, 2021 16:47
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/how-to-configure-nextcloud-to-use-s3-object-storage/15180/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nextcloud: feature request for extraConfig option
6 participants