style: format entire depot with nixpkgs-fmt

This CL can be used to compare the style of nixpkgs-fmt against other
formatters (nixpkgs, alejandra).

Change-Id: I87c6abff6bcb546b02ead15ad0405f81e01b6d9e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4397
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: lukegb <lukegb@tvl.fyi>
Reviewed-by: wpcarro <wpcarro@gmail.com>
Reviewed-by: Profpatsch <mail@profpatsch.de>
Reviewed-by: kanepyork <rikingcoding@gmail.com>
Reviewed-by: tazjin <tazjin@tvl.su>
Reviewed-by: cynthia <cynthia@tvl.fyi>
Reviewed-by: edef <edef@edef.eu>
Reviewed-by: eta <tvl@eta.st>
Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
Vincent Ambo 2022-01-30 19:06:58 +03:00 committed by tazjin
parent 2d10d60fac
commit aa122cbae7
310 changed files with 7278 additions and 5490 deletions

View file

@ -3,7 +3,8 @@
let
cfg = config.services.depot.atward;
description = "atward - (attempt to) cleverly route queries";
in {
in
{
options.services.depot.atward = {
enable = lib.mkEnableOption description;

View file

@ -45,7 +45,8 @@ let
# NixOS in $STATE_DIRECTORY
(cd / && ${rebuild-system}/bin/rebuild-system)
'';
in {
in
{
options.services.depot.auto-deploy = {
enable = lib.mkEnableOption description;

View file

@ -29,7 +29,8 @@ let
echo "Skipping GC, enough space available"
fi
'';
in {
in
{
options.services.depot.automatic-gc = {
enable = lib.mkEnableOption description;

View file

@ -21,7 +21,7 @@ let
(attrValues (mapAttrs (key: value: "-${key} \"${toString value}\"") flags));
# Escapes a unit name for use in systemd
systemdEscape = name: removeSuffix "\n" (readFile (runCommandNoCC "unit-name" {} ''
systemdEscape = name: removeSuffix "\n" (readFile (runCommandNoCC "unit-name" { } ''
${pkgs.systemd}/bin/systemd-escape '${name}' >> $out
''));
@ -42,7 +42,8 @@ let
};
};
};
in {
in
{
options.services.depot.clbot = {
enable = mkEnableOption description;
@ -68,7 +69,7 @@ in {
# (notably the SSH private key) readable by this user outside of
# the module.
users = {
groups.clbot = {};
groups.clbot = { };
users.clbot = {
group = "clbot";

View file

@ -1,2 +1,2 @@
# Make readTree happy at this level.
_: {}
_: { }

View file

@ -8,7 +8,8 @@ let
inherit default;
type = lib.types.str;
};
in {
in
{
options.services.depot.gerrit-queue = {
enable = lib.mkEnableOption description;
gerritUrl = mkStringOption "https://cl.tvl.fyi";

View file

@ -12,7 +12,8 @@
let
cfg = config.services.depot.git-serving;
in {
in
{
options.services.depot.git-serving = with lib; {
enable = mkEnableOption "Enable cgit & josh configuration";

View file

@ -27,7 +27,8 @@ let
exec ${depot.third_party.irccat}/bin/irccat
'';
in {
in
{
options.services.depot.irccat = {
enable = lib.mkEnableOption description;

View file

@ -9,12 +9,13 @@ let
exec -a ${name} ${depot.ops.besadii}/bin/besadii "$@"
'';
gerritHooks = pkgs.runCommandNoCC "gerrit-hooks" {} ''
gerritHooks = pkgs.runCommandNoCC "gerrit-hooks" { } ''
mkdir -p $out
ln -s ${besadiiWithConfig "change-merged"} $out/change-merged
ln -s ${besadiiWithConfig "patchset-created"} $out/patchset-created
'';
in {
in
{
services.gerrit = {
enable = true;
listenAddress = "[::]:4778"; # 4778 - grrt

View file

@ -6,7 +6,8 @@ let
cfg = config.services.depot.nixery;
description = "Nixery - container images on-demand";
storagePath = "/var/lib/nixery/${pkgs.nixpkgsCommits.unstable}";
in {
in
{
options.services.depot.nixery = {
enable = lib.mkEnableOption description;

View file

@ -19,7 +19,8 @@ let
reverse_proxy = true
set_xauthrequest = true
'';
in {
in
{
options.services.depot.oauth2_proxy = {
enable = lib.mkEnableOption description;

View file

@ -4,7 +4,8 @@
let
cfg = config.services.depot.owothia;
description = "owothia - i'm a service owo";
in {
in
{
options.services.depot.owothia = {
enable = lib.mkEnableOption description;

View file

@ -2,7 +2,8 @@
let
cfg = config.services.depot.panettone;
in {
in
{
options.services.depot.panettone = with lib; {
enable = mkEnableOption "Panettone issue tracker";
@ -62,23 +63,26 @@ in {
assertion =
cfg.dbHost != "localhost" || config.services.postgresql.enable;
message = "Panettone requires a postgresql database";
} {
assertion =
cfg.dbHost != "localhost" || config.services.postgresql.enableTCPIP;
message = "Panettone can only connect to the postgresql database over TCP";
} {
assertion =
cfg.dbHost != "localhost" || (lib.any
(user: user.name == cfg.dbUser)
config.services.postgresql.ensureUsers);
message = "Panettone requires a database user";
} {
assertion =
cfg.dbHost != "localhost" || (lib.any
(db: db == cfg.dbName)
config.services.postgresql.ensureDatabases);
message = "Panettone requires a database";
}];
}
{
assertion =
cfg.dbHost != "localhost" || config.services.postgresql.enableTCPIP;
message = "Panettone can only connect to the postgresql database over TCP";
}
{
assertion =
cfg.dbHost != "localhost" || (lib.any
(user: user.name == cfg.dbUser)
config.services.postgresql.ensureUsers);
message = "Panettone requires a database user";
}
{
assertion =
cfg.dbHost != "localhost" || (lib.any
(db: db == cfg.dbName)
config.services.postgresql.ensureDatabases);
message = "Panettone requires a database";
}];
systemd.services.panettone = {
wantedBy = [ "multi-user.target" ];

View file

@ -3,7 +3,8 @@
let
cfg = config.services.depot.paroxysm;
description = "TVL's majestic IRC bot";
in {
in
{
options.services.depot.paroxysm.enable = lib.mkEnableOption description;
config = lib.mkIf cfg.enable {

View file

@ -8,7 +8,8 @@ let
enableDaemon = true;
withKDE = false;
};
in {
in
{
options.services.depot.quassel = with lib; {
enable = mkEnableOption "Quassel IRC daemon";
@ -70,7 +71,7 @@ in {
group = "quassel";
};
groups.quassel = {};
groups.quassel = { };
};
};
}

View file

@ -14,7 +14,8 @@ let
inherit default;
type = lib.types.str;
};
in {
in
{
options.services.depot.restic = {
enable = lib.mkEnableOption description;
bucketEndpoint = mkStringOption "objects.dc-sto1.glesys.net";

View file

@ -27,8 +27,9 @@ let
prepareArgs = args:
concatStringsSep " "
(attrValues (mapAttrs (key: value: "-${key} \"${toString value}\"")
(args // overrideArgs)));
in {
(args // overrideArgs)));
in
{
options.services.depot.smtprelay = {
enable = mkEnableOption description;

View file

@ -4,7 +4,8 @@
let
cfg = config.services.depot.sourcegraph;
in {
in
{
options.services.depot.sourcegraph = with lib; {
enable = mkEnableOption "SourceGraph code search engine";
@ -51,7 +52,8 @@ in {
# Sourcegraph needs a higher nofile limit, it logs warnings
# otherwise (unclear whether it actually affects the service).
extraOptions = [
"--ulimit" "nofile=10000:10000"
"--ulimit"
"nofile=10000:10000"
];
};
};

View file

@ -13,7 +13,7 @@ let
# All Buildkite hooks are actually besadii, but it's being invoked
# with different names.
buildkiteHooks = pkgs.runCommandNoCC "buildkite-hooks" {} ''
buildkiteHooks = pkgs.runCommandNoCC "buildkite-hooks" { } ''
mkdir -p $out/bin
ln -s ${besadiiWithConfig "post-command"} $out/bin/post-command
'';
@ -22,7 +22,8 @@ let
echo 'username=buildkite'
echo "password=$(jq -r '.gerritPassword' /run/agenix/buildkite-besadii-config)"
'';
in {
in
{
options.services.depot.buildkite = {
enable = lib.mkEnableOption description;
agentCount = lib.mkOption {
@ -33,39 +34,43 @@ in {
config = lib.mkIf cfg.enable {
# Run the Buildkite agents using the default upstream module.
services.buildkite-agents = builtins.listToAttrs (map (n: rec {
name = "whitby-${toString n}";
value = {
inherit name;
enable = true;
tokenPath = "/run/agenix/buildkite-agent-token";
hooks.post-command = "${buildkiteHooks}/bin/post-command";
services.buildkite-agents = builtins.listToAttrs (map
(n: rec {
name = "whitby-${toString n}";
value = {
inherit name;
enable = true;
tokenPath = "/run/agenix/buildkite-agent-token";
hooks.post-command = "${buildkiteHooks}/bin/post-command";
runtimePackages = with pkgs; [
bash
coreutils
credentialHelper
curl
git
gnutar
gzip
jq
nix
];
};
}) agents);
runtimePackages = with pkgs; [
bash
coreutils
credentialHelper
curl
git
gnutar
gzip
jq
nix
];
};
})
agents);
# Set up a group for all Buildkite agent users
users = {
groups.buildkite-agents = {};
users = builtins.listToAttrs (map (n: rec {
name = "buildkite-agent-whitby-${toString n}";
value = {
isSystemUser = true;
group = lib.mkForce "buildkite-agents";
extraGroups = [ name "docker" ];
};
}) agents);
groups.buildkite-agents = { };
users = builtins.listToAttrs (map
(n: rec {
name = "buildkite-agent-whitby-${toString n}";
value = {
isSystemUser = true;
group = lib.mkForce "buildkite-agents";
extraGroups = [ name "docker" ];
};
})
agents);
};
};
}

View file

@ -26,7 +26,8 @@ let
inherit (depot.ops) users;
in {
in
{
services.openldap = {
enable = true;
@ -48,7 +49,7 @@ in {
"cn=schema".includes =
map (schema: "${pkgs.openldap}/etc/schema/${schema}.ldif")
[ "core" "cosine" "inetorgperson" "nis" ];
[ "core" "cosine" "inetorgperson" "nis" ];
};
# Contents are immutable at runtime, and adding user accounts etc.