treewide: fix statix errors

This commit is contained in:
Felix Buehler 2023-11-07 23:13:51 +01:00
parent a4b8c2b8da
commit 743d7eead9
48 changed files with 72 additions and 82 deletions

View file

@ -2,7 +2,7 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.services.alertmanager;
domain = config.networking.domain;
inherit (config.networking) domain;
in
{
options.my.services.alertmanager = with lib; {
@ -29,7 +29,7 @@ in
alertmanager = {
enable = true;
listenAddress = "127.0.0.1";
port = cfg.port;
inherit (cfg) port;
configuration = import ./config.nix;
webExternalUrl = "https://alerts.${domain}";
# fix issue: https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/4556

View file

@ -2,7 +2,7 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.services.aria2;
domain = config.networking.domain;
inherit (config.networking) domain;
in
{
options.my.services.aria2 = with lib; {

View file

@ -42,7 +42,7 @@ in
default = false;
};
OnFailureMail = mkOption {
type = types.nullOr (types.str);
type = types.nullOr types.str;
description = lib.mdDoc "Mail address where to send the error report";
default = null;
example = "alarm@mail.com";
@ -122,7 +122,7 @@ in
environment.BORG_RSH = "ssh -o 'StrictHostKeyChecking=no' -i ${cfg.sshKeyFile} -p ${toString cfg.sshPort}";
repo = "${cfg.sshUser}@${cfg.sshHost}:${config.networking.hostName}/";
doInit = cfg.doInit;
inherit (cfg) doInit;
compression = "auto,zstd";
postHook = ''

View file

@ -2,7 +2,7 @@
{ config, lib, ... }:
let
cfg = config.my.services.bazarr;
domain = config.networking.domain;
inherit (config.networking) domain;
port = 6767;
in
{

View file

@ -15,7 +15,7 @@ in
};
settings = mkOption {
type = (pkgs.formats.json { }).type;
inherit (pkgs.formats.json { }) type;
default = { };
example = literalExpression ''
{ ports.http = "8053" };

View file

@ -2,7 +2,7 @@
{ config, lib, ... }:
let
cfg = config.my.services.dyndns;
domain = config.networking.domain;
inherit (config.networking) domain;
in
{
options.my.services.dyndns = with lib; {
@ -25,8 +25,7 @@ in
services.ddclient = {
enable = true;
server = "dyndns.inwx.com";
username = cfg.username;
passwordFile = cfg.passwordFile;
inherit (cfg) username passwordFile;
domains = [ "serverle.${domain}" ];
ipv6 = true;
};

View file

@ -73,7 +73,7 @@ in
};
'';
type = lib.types.attrsOf (lib.types.submodule (
{ ... }: {
_: {
options = {
# enable = lib.mkEnableOption "exportarr-${name}";
port = lib.mkOption {

View file

@ -2,7 +2,7 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.services.freshrss;
domain = config.networking.domain;
inherit (config.networking) domain;
in
{
options.my.services.freshrss = with lib; {

View file

@ -2,7 +2,7 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.services.gitea;
domain = config.networking.domain;
inherit (config.networking) domain;
in
{
options.my.services.gitea = with lib; {

View file

@ -2,7 +2,7 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.services.grafana;
domain = config.networking.domain;
inherit (config.networking) domain;
in
{
options.my.services.grafana = with lib; {

View file

@ -2,14 +2,14 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.services.hedgedoc;
domain = config.networking.domain;
inherit (config.networking) domain;
in
{
options.my.services.hedgedoc = with lib; {
enable = mkEnableOption "Hedgedoc Music Server";
settings = mkOption {
type = (pkgs.formats.json { }).type;
inherit (pkgs.formats.json { }) type;
default = { };
example = {
"LastFM.ApiKey" = "MYKEY";

View file

@ -2,7 +2,7 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.services.home-assistant;
domain = config.networking.domain;
inherit (config.networking) domain;
in
{
options.my.services.home-assistant = with lib; {
@ -83,14 +83,12 @@ in
services.home-assistant = {
enable = true;
package = cfg.package;
inherit (cfg) package;
config = {
homeassistant = {
name = "Home";
latitude = cfg.latitude;
longitude = cfg.longitude;
elevation = cfg.elevation;
inherit (cfg) latitude longitude elevation;
unit_system = "metric";
time_zone = cfg.timezone;
};

View file

@ -2,7 +2,7 @@
{ config, lib, inputs, ... }:
let
cfg = config.my.services.homepage;
domain = config.networking.domain;
inherit (config.networking) domain;
in
{
options.my.services.homepage = with lib; {

View file

@ -113,14 +113,11 @@
apps);
in
{
name = cat.name;
inherit (cat) name;
items = lib.forEach catApps (a: {
name = a.dashboard.name;
inherit (a.dashboard) name link type method;
icon = lib.optionalString (a.dashboard.icon != null) "fas fa-${a.dashboard.icon}";
url = a.dashboard.link;
target = "_blank";
type = a.dashboard.type;
method = a.dashboard.method;
});
}
);

View file

@ -2,7 +2,7 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.services.homer;
domain = config.networking.domain;
inherit (config.networking) domain;
homeConfig = {
title = "Dashboard";

View file

@ -2,7 +2,7 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.services.jellyfin;
domain = config.networking.domain;
inherit (config.networking) domain;
port = 8096;
# enable monitoring
jellyfin-with-metrics = pkgs.jellyfin.overrideAttrs (attrs: {

View file

@ -2,7 +2,7 @@
{ config, lib, ... }:
let
cfg = config.my.services.jellyseerr;
domain = config.networking.domain;
inherit (config.networking) domain;
in
{
options.my.services.jellyseerr = with lib; {

View file

@ -83,22 +83,21 @@ in
type = "local";
local = {
# having the "fake" directory is important, because loki is running in single-tenant mode
directory = (pkgs.writeTextDir "fake/loki-rules.yml" (builtins.toJSON {
directory = pkgs.writeTextDir "fake/loki-rules.yml" (builtins.toJSON {
groups = [
{
name = "alerting-rules";
rules = lib.mapAttrsToList
(name: opts: {
alert = name;
expr = opts.condition;
inherit (opts) condition labels;
for = opts.time;
labels = opts.labels;
annotations.description = opts.description;
})
(cfg.rules);
cfg.rules;
}
];
}));
});
};
};

View file

@ -2,14 +2,14 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.services.navidrome;
domain = config.networking.domain;
inherit (config.networking) domain;
in
{
options.my.services.navidrome = with lib; {
enable = mkEnableOption "Navidrome Music Server";
settings = mkOption {
type = (pkgs.formats.json { }).type;
inherit (pkgs.formats.json { }) type;
default = {
EnableSharing = true;
};

View file

@ -2,7 +2,7 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.services.nextcloud;
domain = config.networking.domain;
inherit (config.networking) domain;
in
{
options.my.services.nextcloud = with lib; {
@ -60,7 +60,7 @@ in
config = {
adminuser = cfg.admin;
adminpassFile = cfg.passwordFile;
defaultPhoneRegion = cfg.defaultPhoneRegion;
inherit (cfg) defaultPhoneRegion;
overwriteProtocol = "https"; # Nginx only allows SSL

View file

@ -250,8 +250,8 @@ in
virtualHosts =
let
genAttrs' = values: f: lib.listToAttrs (map f values);
domain = config.networking.domain;
mkVHost = ({ subdomain, ... } @ args: lib.nameValuePair
inherit (config.networking) domain;
mkVHost = { subdomain, ... } @ args: lib.nameValuePair
"${subdomain}.${domain}"
(lib.foldl lib.recursiveUpdate { } [
# Base configuration
@ -309,7 +309,7 @@ in
};
})
])
);
;
in
genAttrs' cfg.virtualHosts mkVHost;
sso = {
@ -396,7 +396,7 @@ in
# Use DNS wildcard certificate
certs =
let
domain = config.networking.domain;
inherit (config.networking) domain;
in
with pkgs;
{

View file

@ -2,7 +2,7 @@
{ config, lib, ... }:
let
cfg = config.my.services.paperless;
domain = config.networking.domain;
inherit (config.networking) domain;
in
{
options.my.services.paperless = with lib; {

View file

@ -2,7 +2,7 @@
{ config, lib, ... }:
let
cfg = config.my.services.passworts;
domain = config.networking.domain;
inherit (config.networking) domain;
in
{
options.my.services.passworts = with lib; {

View file

@ -2,7 +2,7 @@
{ config, lib, ... }:
let
cfg = config.my.services.photoprism;
domain = config.networking.domain;
inherit (config.networking) domain;
in
{
options.my.services.photoprism = {
@ -49,10 +49,7 @@ in
config = lib.mkIf cfg.enable {
services.photoprism = {
enable = true;
passwordFile = cfg.passwordFile;
port = cfg.port;
originalsPath = cfg.originalsPath;
settings = cfg.settings;
inherit (cfg) passwordFile port originalsPath settings;
};
my.services.nginx.virtualHosts = [

View file

@ -2,7 +2,7 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.services.prometheus;
domain = config.networking.domain;
inherit (config.networking) domain;
in
{
options.my.services.prometheus = with lib; {
@ -100,13 +100,13 @@ in
alert = name;
expr = opts.condition;
for = opts.time;
labels = opts.labels;
inherit (opts) labels;
annotations = {
description = opts.description;
inherit (opts) description;
grafana = lib.optionalString config.services.grafana.enable "https://visualization.${domain}";
};
})
(cfg.rules);
cfg.rules;
}
];
}))

View file

@ -2,7 +2,7 @@
{ config, lib, ... }:
let
cfg = config.my.services.promtail;
domain = config.networking.domain;
inherit (config.networking) domain;
in
{
options.my.services.promtail = with lib; {

View file

@ -2,7 +2,7 @@
{ config, lib, ... }:
let
cfg = config.my.services.prowlarr;
domain = config.networking.domain;
inherit (config.networking) domain;
port = 9696;
in
{
@ -46,7 +46,7 @@ in
my.services.exportarr.prowlarr = {
port = port + 1;
url = "http://127.0.0.1:${toString port}";
apiKeyFile = cfg.apiKeyFile;
inherit (cfg) apiKeyFile;
};
services.prometheus.scrapeConfigs = [

View file

@ -2,7 +2,7 @@
{ config, lib, ... }:
let
cfg = config.my.services.radarr;
domain = config.networking.domain;
inherit (config.networking) domain;
port = 7878;
in
{
@ -36,7 +36,7 @@ in
my.services.exportarr.radarr = {
port = port + 1;
url = "http://127.0.0.1:${toString port}";
apiKeyFile = cfg.apiKeyFile;
inherit (cfg) apiKeyFile;
};
services.prometheus.scrapeConfigs = [

View file

@ -2,7 +2,7 @@
{ config, lib, ... }:
let
cfg = config.my.services.sonarr;
domain = config.networking.domain;
inherit (config.networking) domain;
port = 8989;
in
{
@ -36,7 +36,7 @@ in
my.services.exportarr.sonarr = {
port = port + 1;
url = "http://127.0.0.1:${toString port}";
apiKeyFile = cfg.apiKeyFile;
inherit (cfg) apiKeyFile;
};
services.prometheus.scrapeConfigs = [

View file

@ -2,7 +2,7 @@
{ config, lib, ... }:
let
cfg = config.my.services.tandoor-recipes;
domain = config.networking.domain;
inherit (config.networking) domain;
in
{
options.my.services.tandoor-recipes = with lib; {
@ -18,7 +18,7 @@ in
config = lib.mkIf cfg.enable {
services.tandoor-recipes = {
enable = true;
port = cfg.port;
inherit (cfg) port;
};
# Proxy to Tandoor-Recipes