mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-28 15:54:32 +00:00
4f0dadbf38
After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-builda08b3a4d19
.tar.gz \ --argstr baseRevb32a094368
result/bin/apply-formatting $NIXPKGS_PATH
103 lines
2.7 KiB
Nix
103 lines
2.7 KiB
Nix
{
|
|
name,
|
|
pkgs,
|
|
testBase,
|
|
system,
|
|
...
|
|
}:
|
|
|
|
with import ../../lib/testing-python.nix { inherit system pkgs; };
|
|
runTest (
|
|
{ config, ... }:
|
|
let
|
|
inherit (config) adminuser;
|
|
in
|
|
{
|
|
inherit name;
|
|
meta = with pkgs.lib.maintainers; {
|
|
maintainers = [
|
|
eqyiel
|
|
ma27
|
|
];
|
|
};
|
|
|
|
imports = [ testBase ];
|
|
|
|
nodes = {
|
|
nextcloud =
|
|
{ config, pkgs, ... }:
|
|
{
|
|
environment.systemPackages = [ pkgs.jq ];
|
|
services.nextcloud = {
|
|
caching = {
|
|
apcu = false;
|
|
redis = true;
|
|
memcached = false;
|
|
};
|
|
# This test also validates that we can use an "external" database
|
|
database.createLocally = false;
|
|
config = {
|
|
dbtype = "pgsql";
|
|
dbname = "nextcloud";
|
|
dbuser = adminuser;
|
|
dbpassFile = config.services.nextcloud.config.adminpassFile;
|
|
};
|
|
|
|
secretFile = "/etc/nextcloud-secrets.json";
|
|
|
|
settings = {
|
|
allow_local_remote_servers = true;
|
|
redis = {
|
|
dbindex = 0;
|
|
timeout = 1.5;
|
|
# password handled via secretfile below
|
|
};
|
|
};
|
|
configureRedis = true;
|
|
};
|
|
|
|
services.redis.servers."nextcloud" = {
|
|
enable = true;
|
|
port = 6379;
|
|
requirePass = "secret";
|
|
};
|
|
|
|
systemd.services.nextcloud-setup = {
|
|
requires = [ "postgresql.service" ];
|
|
after = [ "postgresql.service" ];
|
|
};
|
|
|
|
services.postgresql = {
|
|
enable = true;
|
|
package = pkgs.postgresql_14;
|
|
};
|
|
systemd.services.postgresql.postStart = pkgs.lib.mkAfter ''
|
|
password=$(cat ${config.services.nextcloud.config.dbpassFile})
|
|
${config.services.postgresql.package}/bin/psql <<EOF
|
|
CREATE ROLE ${adminuser} WITH LOGIN PASSWORD '$password' CREATEDB;
|
|
CREATE DATABASE nextcloud;
|
|
GRANT ALL PRIVILEGES ON DATABASE nextcloud TO ${adminuser};
|
|
EOF
|
|
'';
|
|
|
|
# This file is meant to contain secret options which should
|
|
# not go into the nix store. Here it is just used to set the
|
|
# redis password.
|
|
environment.etc."nextcloud-secrets.json".text = ''
|
|
{
|
|
"redis": {
|
|
"password": "secret"
|
|
}
|
|
}
|
|
'';
|
|
};
|
|
};
|
|
|
|
test-helpers.extraTests = ''
|
|
with subtest("non-empty redis cache"):
|
|
# redis cache should not be empty
|
|
nextcloud.fail('test 0 -lt "$(redis-cli --pass secret --json KEYS "*" | jq "len")"')
|
|
'';
|
|
}
|
|
)
|