Description
Nixpkgs version
- Stable (24.11)
Describe the bug
I'm configuring Dokuwiki with the oauthgeneric plugin and I'm setting the scope option to a list of strings. This gets rendered as a comma separated single string in the settings file instead of a php array construct as required by the plugin.
Steps to reproduce
{ config, lib, pkgs, ...}:
let
plugin-oauth = pkgs.stdenv.mkDerivation (finalAttrs: {
name = "oauth";
version = "2024-11-02";
src = pkgs.fetchFromGitHub {
owner = "cosmocode";
repo = "dokuwiki-plugin-oauth";
rev = finalAttrs.version;
hash = "sha256-RYWBfrZOg2Vv6JefVHgRvfQ/UnU2yJJzmfS3nj+fRYc=";
};
installPhase = "mkdir -p $out; cp -R * $out/";
});
plugin-oauthgeneric = pkgs.stdenv.mkDerivation (finalAttrs: {
name = "oauthgeneric";
version = "2024-03-21";
src = pkgs.fetchFromGitHub {
owner = "cosmocode";
repo = "dokuwiki-plugin-oauthgeneric";
rev = finalAttrs.version;
hash = "sha256-lcD7u6Rr+FXo6rAT8uY1fnbDlSVPHTtDacPdsZBoHGg=";
};
installPhase = "mkdir -p $out; cp -R * $out/";
});
in {
services.dokuwiki = {
webserver = "nginx";
sites.wiki = {
enable = true;
stateDir = "/srv/dokuwiki/";
plugins = [ plugin-oauth plugin-oauthgeneric ];
settings = {
useacl = true;
userewrite = true;
authtype = "oauth";
superuser = "@admin";
title = "Wiki";
basedir = "/wiki/";
plugin.oauth = {
register-on-auth = true;
};
plugin.oauthgeneric = {
key = "xxx";
secret._file = "xxx";
authurl = "xxx";
tokenurl = "xxx";
userurl = "xxx";
authmethod = 1; # Bearer Header
scopes = [ "email" "openid" "profile" "offline_access" ];
needs-state = true;
json-user = "preferred_username";
json-name = "name";
json-mail = "email";
json-grps = "groups";
};
};
};
};
}
This produces the following local.php:
<?php
$conf['authtype'] = 'oauth';
$conf['basedir'] = '/wiki/';
$conf['plugin']['oauth']['register-on-auth'] = 1;
$conf['plugin']['oauthgeneric']['authmethod'] = 1;
$conf['plugin']['oauthgeneric']['authurl'] = 'xxx';
$conf['plugin']['oauthgeneric']['json-grps'] = 'groups';
$conf['plugin']['oauthgeneric']['json-mail'] = 'email';
$conf['plugin']['oauthgeneric']['json-name'] = 'name';
$conf['plugin']['oauthgeneric']['json-user'] = 'preferred_username';
$conf['plugin']['oauthgeneric']['key'] = 'xxx';
$conf['plugin']['oauthgeneric']['needs-state'] = 1;
$conf['plugin']['oauthgeneric']['scopes'] = 'email,openid,profile,offline_access';
$conf['plugin']['oauthgeneric']['secret'] = 'xxx';
$conf['plugin']['oauthgeneric']['tokenurl'] = 'xxx';
$conf['plugin']['oauthgeneric']['userurl'] = 'xxx';
$conf['savedir'] = '/srv/dokuwiki/';
$conf['superuser'] = '@admin';
$conf['title'] = 'Wiki';
$conf['useacl'] = 1;
$conf['userewrite'] = 1;
I have to set scopes._raw = ''array("email", "openid", "profile", "offline_access")''
to get the correct output:
$conf['plugin']['oauthgeneric']['scopes'] = array("email", "openid", "profile", "offline_access");
Expected behaviour
Render lists as php arrays.
Screenshots
No response
Relevant log output
Additional context
The conversion happens in
nixpkgs/nixos/modules/services/web-apps/dokuwiki.nix
Lines 47 to 58 in a45fa36
If this conversation was used because other list options require it, would it be possible to make the rendering for list configurable? Maybe a special _array
attribute?
System metadata
- system:
"x86_64-linux"
- host os:
Linux 6.6.74, NixOS, 24.11 (Vicuna), 24.11.20250129.59e618d
- multi-user?:
yes
- sandbox:
yes
- version:
nix-env (Nix) 2.24.12
- nixpkgs:
/nix/store/y43mj3x0256cm2siypjb3jpk96g0sx9p-source
Notify maintainers
@1000101
@onny
@dandellion
@e1mo
Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE
.)
I assert that this issue is relevant for Nixpkgs
- I assert that this is a bug and not a support request.
- I assert that this is not a duplicate of an existing issue.
- I assert that I have read the NixOS Code of Conduct and agree to abide by it.
Is this issue important to you?
Add a 👍 reaction to issues you find important.