mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-24 09:54:40 +02:00
treewide: fix statix errors
This commit is contained in:
parent
a4b8c2b8da
commit
743d7eead9
48 changed files with 72 additions and 82 deletions
|
@ -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
|
||||
|
|
|
@ -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; {
|
||||
|
|
|
@ -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 = ''
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.services.bazarr;
|
||||
domain = config.networking.domain;
|
||||
inherit (config.networking) domain;
|
||||
port = 6767;
|
||||
in
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ in
|
|||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = (pkgs.formats.json { }).type;
|
||||
inherit (pkgs.formats.json { }) type;
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
{ ports.http = "8053" };
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -73,7 +73,7 @@ in
|
|||
};
|
||||
'';
|
||||
type = lib.types.attrsOf (lib.types.submodule (
|
||||
{ ... }: {
|
||||
_: {
|
||||
options = {
|
||||
# enable = lib.mkEnableOption "exportarr-${name}";
|
||||
port = lib.mkOption {
|
||||
|
|
|
@ -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; {
|
||||
|
|
|
@ -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; {
|
||||
|
|
|
@ -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; {
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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; {
|
||||
|
|
|
@ -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;
|
||||
});
|
||||
}
|
||||
);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.services.homer;
|
||||
domain = config.networking.domain;
|
||||
inherit (config.networking) domain;
|
||||
|
||||
homeConfig = {
|
||||
title = "Dashboard";
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -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; {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
];
|
||||
}));
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
{
|
||||
|
|
|
@ -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; {
|
||||
|
|
|
@ -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; {
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
];
|
||||
}))
|
||||
|
|
|
@ -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; {
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue