Commit Graph

35 Commits

Author SHA1 Message Date
Sandro Jäckel
a6c356974a
nixos/mediawiki: use the same php everywhere
otherwise we might end up with eg: php 8.1 and php 8.2 mixed
2024-04-15 23:02:26 +02:00
stuebinm
6afb255d97 nixos: remove all uses of lib.mdDoc
these changes were generated with nixq 0.0.2, by running

  nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix

two mentions of the mdDoc function remain in nixos/, both of which
are inside of comments.

Since lib.mdDoc is already defined as just id, this commit is a no-op as
far as Nix (and the built manual) is concerned.
2024-04-13 10:07:35 -07:00
Weijia Wang
feeae486de
Merge pull request #261702 from h7x4/replace-mkoption-with-mkpackageoption
treewide: use `mkPackageOption`
2023-11-30 02:49:30 +01:00
h7x4
0a37316d6c
treewide: use mkPackageOption
This commit replaces a lot of usages of `mkOption` with the package
type, to be `mkPackageOption`, in order to reduce the amount of code.
2023-11-27 01:28:36 +01:00
Sandro Jäckel
960527707b nixos/mediawiki: don't clear default installed extensions 2023-11-26 20:29:49 +01:00
Sandro Jäckel
8ae9c8640c nixos/mediawiki: don't assume language of main page
The mainpage might be named Hauptseite and mediawiki redirects from
/wiki/ on its own to there
2023-11-26 19:59:32 +01:00
Sandro Jäckel
f68be841c9 nixos/mediawiki: use fastcgi.conf file which contains extra parameter 2023-11-26 19:59:32 +01:00
Jörg Thalheim
f468e0d111 nixos/mediawiki: quote shell flags passed to installer 2023-11-26 17:25:14 +01:00
Jörg Thalheim
0bd8759d1c nixos/mediawiki: drop sqlite variant
Probably no one ever tested this, mediawiki tries to create the database inside the read-only
package. There might be a proper fix but for now it's better to not advertise unsupported options.
2023-11-26 17:25:14 +01:00
Sandro
e580ab8c3e nixos/mediawiki: update url option defaultText 2023-11-26 17:24:15 +01:00
Maximilian Bosch
48459567ae nixos/postgresql: drop ensurePermissions, fix ensureUsers for postgresql15
Closes #216989

First of all, a bit of context: in PostgreSQL, newly created users don't
have the CREATE privilege on the public schema of a database even with
`ALL PRIVILEGES` granted via `ensurePermissions` which is how most of
the DB users are currently set up "declaratively"[1]. This means e.g. a
freshly deployed Nextcloud service will break early because Nextcloud
itself cannot CREATE any tables in the public schema anymore.

The other issue here is that `ensurePermissions` is a mere hack. It's
effectively a mixture of SQL code (e.g. `DATABASE foo` is relying on how
a value is substituted in a query. You'd have to parse a subset of SQL
to actually know which object are permissions granted to for a user).

After analyzing the existing modules I realized that in every case with
a single exception[2] the UNIX system user is equal to the db user is
equal to the db name and I don't see a compelling reason why people
would change that in 99% of the cases. In fact, some modules would even
break if you'd change that because the declarations of the system user &
the db user are mixed up[3].

So I decided to go with something new which restricts the ways to use
`ensure*` options rather than expanding those[4]. Effectively this means
that

* The DB user _must_ be equal to the DB name.
* Permissions are granted via `ensureDBOwnerhip` for an attribute-set in
  `ensureUsers`. That way, the user is actually the owner and can
  perform `CREATE`.
* For such a postgres user, a database must be declared in
  `ensureDatabases`.

For anything else, a custom state management should be implemented. This
can either be `initialScript`, doing it manual, outside of the module or
by implementing proper state management for postgresql[5], but the
current state of `ensure*` isn't even declarative, but a convergent tool
which is what Nix actually claims to _not_ do.

Regarding existing setups: there are effectively two options:

* Leave everything as-is (assuming that system user == db user == db
  name): then the DB user will automatically become the DB owner and
  everything else stays the same.

* Drop the `createDatabase = true;` declarations: nothing will change
  because a removal of `ensure*` statements is ignored, so it doesn't
  matter at all whether this option is kept after the first deploy (and
  later on you'd usually restore from backups anyways).

  The DB user isn't the owner of the DB then, but for an existing setup
  this is irrelevant because CREATE on the public schema isn't revoked
  from existing users (only not granted for new users).

[1] not really declarative though because removals of these statements
    are simply ignored for instance: https://github.com/NixOS/nixpkgs/issues/206467
[2] `services.invidious`: I removed the `ensure*` part temporarily
    because it IMHO falls into the category "manage the state on your
    own" (see the commit message). See also
    https://github.com/NixOS/nixpkgs/pull/265857
[3] e.g. roundcube had `"DATABASE ${cfg.database.username}" = "ALL PRIVILEGES";`
[4] As opposed to other changes that are considered a potential fix, but
    also add more things like collation for DBs or passwords that are
    _never_ touched again when changing those.
[5] As suggested in e.g. https://github.com/NixOS/nixpkgs/issues/206467
2023-11-13 17:16:25 +01:00
Jörg Thalheim
a7c984b7a2 nixos/mediawiki: pin php to 8.1 2023-11-06 22:52:42 +01:00
Jörg Thalheim
915ad8a77b nixos/mediawiki: fix rewrites for static ressources and rest API 2023-11-06 22:52:42 +01:00
Jörg Thalheim
07c70a41ab nixos/mediawiki: add nginx option
mediawiki: configure uploadsDir
2023-10-04 22:21:55 +01:00
Jörg Thalheim
d3036bb608 mediawiki: fix group used when apache2 is used 2023-06-07 17:31:44 +02:00
Jörg Thalheim
077e950f7a nixos/mediawiki: also test fcgi socket 2023-05-01 20:51:11 +02:00
Jörg Thalheim
d309952a5d nixos/mediawiki: make apache optional 2023-05-01 20:51:11 +02:00
Jörg Thalheim
c129c9fac0 nixos/mediawiki: drop $wgEmergencyContact setting 2023-04-24 14:25:00 +02:00
Jörg Thalheim
1d2a96eda3 nixos/mediawiki: move virtualHost to httpd.virtualHost
This is a preparation to also allow nginx as a http server.
2023-04-24 14:24:52 +02:00
Jörg Thalheim
d9c613d746 mediawiki: add support for postgresql 2023-04-04 07:50:04 +02:00
figsoda
6bb0dbf91f nixos: fix typos 2022-12-17 19:31:14 -05:00
Artturin
6910a4eea0 treewide: makeWrapper to nativeBuildInputs
this should be all of them other than the failed splices
found with nixpkgs-lint
2022-09-26 17:53:26 +03:00
revol-xut
0e291be644
mediawiki: fix correctly setting --dbtype flag 2022-09-06 22:17:47 +02:00
pennae
ef176dcf7e nixos/*: automatically convert option descriptions
conversions were done using https://github.com/pennae/nix-doc-munge
using (probably) rev f34e145 running

    nix-doc-munge nixos/**/*.nix
    nix-doc-munge --import nixos/**/*.nix

the tool ensures that only changes that could affect the generated
manual *but don't* are committed, other changes require manual review
and are discarded.
2022-08-31 16:32:53 +02:00
pennae
087472b1e5 nixos/*: automatically convert option docs 2022-08-06 20:39:12 +02:00
pennae
3aebb4a2be nixos/*: normalize link format
make (almost) all links appear on only a single line, with no
unnecessary whitespace, using double quotes for attributes. this lets us
automatically convert them to markdown easily.

the few remaining links are extremely long link in a gnome module, we'll
come back to those at a later date.
2022-08-03 21:57:46 +02:00
Naïm Favier
2ddc335e6f
nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
Fritz Otlinghaus
e67b6193aa
nixos/mediawiki: add name type 2021-01-31 11:28:04 +01:00
Martin Milata
9bbd1037ec nixos/mediawiki: allow using default extensions 2020-03-26 18:26:07 +01:00
Aaron Andersen
01ccb67598 nixos/httpd: code cleanup 2020-01-31 20:39:12 -05:00
Aaron Andersen
79215f0df1 nixos/httpd: limit serving web content to virtual hosts, convert virtualHosts option type from listOf to attrsOf, add ACME integration 2019-12-24 20:27:48 -05:00
Janne Heß
d6c08776ba treewide: Switch to system users 2019-10-12 22:25:28 +02:00
Aaron Andersen
400c6aac71 nixos/phpfpm: deprecate extraConfig options in favor of settings options 2019-08-23 07:56:27 -04:00
Aaron Andersen
62b774a700 nixos/phpfpm: add socket option to replace the listen option 2019-08-23 07:56:21 -04:00
Aaron Andersen
455d33f514 nixos/mediawiki: init service to replace httpd subservice 2019-07-23 22:02:33 -04:00