From c3cfcf1b61e4335ca138dadbaa6bee0caa7a4467 Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Thu, 9 Oct 2025 21:35:41 +0200 Subject: [PATCH] Replace `builtins.toString` with `toString` --- modules/home/de/hyprland/keybinds.nix | 4 ++-- modules/system/meta/domains.nix | 2 +- modules/system/meta/ports.nix | 2 +- modules/system/services/alloy.nix | 8 ++++---- modules/system/services/caddy.nix | 6 +++--- modules/system/services/crowdsec/bouncers.nix | 2 +- modules/system/services/crowdsec/default.nix | 4 ++-- modules/system/services/it-tools.nix | 2 +- modules/system/services/memos.nix | 2 +- modules/system/services/ntfy.nix | 2 +- modules/system/services/openspeedtest.nix | 2 +- modules/system/services/radicale.nix | 2 +- modules/system/services/syncthing.nix | 6 +++--- modules/system/services/victorialogs.nix | 2 +- modules/system/services/victoriametrics.nix | 2 +- 15 files changed, 24 insertions(+), 24 deletions(-) diff --git a/modules/home/de/hyprland/keybinds.nix b/modules/home/de/hyprland/keybinds.nix index 662bcf4..74f953f 100644 --- a/modules/home/de/hyprland/keybinds.nix +++ b/modules/home/de/hyprland/keybinds.nix @@ -51,8 +51,8 @@ # Switch workspace ${lib.concatMapStringsSep "\n" (n: '' - bind = SUPER, ${builtins.toString n}, focusworkspaceoncurrentmonitor, ${builtins.toString n} - bind = SUPER SHIFT, ${builtins.toString n}, movetoworkspacesilent, ${builtins.toString n} + bind = SUPER, ${toString n}, focusworkspaceoncurrentmonitor, ${toString n} + bind = SUPER SHIFT, ${toString n}, movetoworkspacesilent, ${toString n} '') (lib.range 1 9)} # Manage session diff --git a/modules/system/meta/domains.nix b/modules/system/meta/domains.nix index 5771d80..ff52f18 100644 --- a/modules/system/meta/domains.nix +++ b/modules/system/meta/domains.nix @@ -41,7 +41,7 @@ in inherit domain; }) ) - |> lib.groupBy (entry: builtins.toString entry.domain) + |> lib.groupBy (entry: toString entry.domain) |> lib.mapAttrs (_: values: values |> lib.map (value: value.file)) |> lib.filterAttrs (_: files: lib.length files > 1); diff --git a/modules/system/meta/ports.nix b/modules/system/meta/ports.nix index 95a18b9..68e3a0b 100644 --- a/modules/system/meta/ports.nix +++ b/modules/system/meta/ports.nix @@ -35,7 +35,7 @@ in inherit port; }) ) - |> lib.groupBy (entry: builtins.toString entry.port) + |> lib.groupBy (entry: toString entry.port) |> lib.mapAttrs (_: values: values |> lib.map (value: value.file)) |> lib.filterAttrs (_: files: lib.length files > 1); diff --git a/modules/system/services/alloy.nix b/modules/system/services/alloy.nix index 3050f5c..6f86211 100644 --- a/modules/system/services/alloy.nix +++ b/modules/system/services/alloy.nix @@ -71,7 +71,7 @@ in services.alloy = { enable = true; extraFlags = [ - "--server.http.listen-addr=localhost:${builtins.toString cfg.port}" + "--server.http.listen-addr=localhost:${toString cfg.port}" "--disable-reporting" ]; }; @@ -121,7 +121,7 @@ in text = '' prometheus.scrape "victorialogs" { targets = [{ - __address__ = "localhost:${builtins.toString config.custom.services.victorialogs.port}", + __address__ = "localhost:${toString config.custom.services.victorialogs.port}", job = "victorialogs", instance = constants.hostname, }] @@ -135,7 +135,7 @@ in text = '' prometheus.scrape "caddy" { targets = [{ - __address__ = "localhost:${builtins.toString config.custom.services.caddy.metricsPort}", + __address__ = "localhost:${toString config.custom.services.caddy.metricsPort}", job = "caddy", instance = constants.hostname, }] @@ -149,7 +149,7 @@ in text = '' prometheus.scrape "crowdsec" { targets = [{ - __address__ = "localhost:${builtins.toString config.custom.services.crowdsec.prometheusPort}", + __address__ = "localhost:${toString config.custom.services.crowdsec.prometheusPort}", job = "crowdsec", instance = constants.hostname, }] diff --git a/modules/system/services/caddy.nix b/modules/system/services/caddy.nix index dc01b11..c66f9fb 100644 --- a/modules/system/services/caddy.nix +++ b/modules/system/services/caddy.nix @@ -35,7 +35,7 @@ let import subdomain-log ${domain} @${subdomainOf domain} host ${domain} handle @${subdomainOf domain} { - reverse_proxy localhost:${builtins.toString port} + reverse_proxy localhost:${toString port} } ''; in @@ -48,7 +48,7 @@ let logFormat = "output file ${config.services.caddy.logDir}/${domain}.log { mode 640 }"; extraConfig = '' bind tailscale/${subdomainOf domain} - reverse_proxy localhost:${builtins.toString port} + reverse_proxy localhost:${toString port} ''; }; in @@ -109,7 +109,7 @@ in admin off metrics { per_host } ''; - virtualHosts.":${builtins.toString cfg.metricsPort}" = { + virtualHosts.":${toString cfg.metricsPort}" = { logFormat = ""; extraConfig = "metrics /metrics"; }; diff --git a/modules/system/services/crowdsec/bouncers.nix b/modules/system/services/crowdsec/bouncers.nix index 9326e41..d9b4a28 100644 --- a/modules/system/services/crowdsec/bouncers.nix +++ b/modules/system/services/crowdsec/bouncers.nix @@ -19,7 +19,7 @@ in package = inputs.crowdsec.packages.${pkgs.system}.crowdsec-firewall-bouncer; settings = { api_key = "cs-firewall-bouncer"; - api_url = "http://localhost:${builtins.toString cfg.apiPort}"; + api_url = "http://localhost:${toString cfg.apiPort}"; }; }; diff --git a/modules/system/services/crowdsec/default.nix b/modules/system/services/crowdsec/default.nix index 8578844..1b3448e 100644 --- a/modules/system/services/crowdsec/default.nix +++ b/modules/system/services/crowdsec/default.nix @@ -48,8 +48,8 @@ in package = inputs.crowdsec.packages.${pkgs.system}.crowdsec; enrollKeyFile = config.sops.secrets."crowdsec/enrollment-key".path; settings = { - api.server.listen_uri = "localhost:${builtins.toString cfg.apiPort}"; - cscli.prometheus_uri = "http://localhost:${builtins.toString cfg.prometheusPort}"; + api.server.listen_uri = "localhost:${toString cfg.apiPort}"; + cscli.prometheus_uri = "http://localhost:${toString cfg.prometheusPort}"; prometheus = { listen_addr = "localhost"; listen_port = cfg.prometheusPort; diff --git a/modules/system/services/it-tools.nix b/modules/system/services/it-tools.nix index 1f27a9f..ab38c23 100644 --- a/modules/system/services/it-tools.nix +++ b/modules/system/services/it-tools.nix @@ -28,7 +28,7 @@ in services.static-web-server = { enable = true; - listen = "[::]:${builtins.toString cfg.port}"; + listen = "[::]:${toString cfg.port}"; root = "${pkgs.it-tools}/lib"; configuration.general.health = true; }; diff --git a/modules/system/services/memos.nix b/modules/system/services/memos.nix index a2e88a3..a96792e 100644 --- a/modules/system/services/memos.nix +++ b/modules/system/services/memos.nix @@ -42,7 +42,7 @@ in enable = true; package = pkgs-unstable.memos; settings = options.services.memos.settings.default // { - MEMOS_PORT = builtins.toString cfg.port; + MEMOS_PORT = toString cfg.port; MEMOS_INSTANCE_URL = "https://${cfg.domain}"; }; }; diff --git a/modules/system/services/ntfy.nix b/modules/system/services/ntfy.nix index ff2f543..29aca35 100644 --- a/modules/system/services/ntfy.nix +++ b/modules/system/services/ntfy.nix @@ -25,7 +25,7 @@ in enable = true; settings = lib.mkForce { base-url = "https://${cfg.domain}"; - listen-http = "localhost:${builtins.toString cfg.port}"; + listen-http = "localhost:${toString cfg.port}"; behind-proxy = true; web-root = "disable"; }; diff --git a/modules/system/services/openspeedtest.nix b/modules/system/services/openspeedtest.nix index ebcc0fc..186140e 100644 --- a/modules/system/services/openspeedtest.nix +++ b/modules/system/services/openspeedtest.nix @@ -23,7 +23,7 @@ in virtualisation.oci-containers.containers.openspeedtest = { image = "openspeedtest/latest"; - ports = [ "127.0.0.1:${builtins.toString cfg.port}:3000" ]; + ports = [ "127.0.0.1:${toString cfg.port}:3000" ]; pull = "newer"; }; }; diff --git a/modules/system/services/radicale.nix b/modules/system/services/radicale.nix index e0d29d0..1e7b1b1 100644 --- a/modules/system/services/radicale.nix +++ b/modules/system/services/radicale.nix @@ -38,7 +38,7 @@ in services.radicale = { enable = true; settings = { - server.hosts = "localhost:${builtins.toString cfg.port}"; + server.hosts = "localhost:${toString cfg.port}"; auth = { type = "htpasswd"; htpasswd_filename = config.sops.secrets."radicale/htpasswd".path; diff --git a/modules/system/services/syncthing.nix b/modules/system/services/syncthing.nix index 039ec2b..5a5278f 100644 --- a/modules/system/services/syncthing.nix +++ b/modules/system/services/syncthing.nix @@ -78,7 +78,7 @@ in group = lib.mkIf (!cfg.isServer) "users"; dataDir = lib.mkIf (!cfg.isServer) "/home/seb"; - guiAddress = lib.mkIf cfg.isServer "localhost:${builtins.toString cfg.gui.port}"; + guiAddress = lib.mkIf cfg.isServer "localhost:${toString cfg.gui.port}"; cert = lib.mkIf useStaticTls config.sops.secrets."syncthing/cert".path; key = lib.mkIf useStaticTls config.sops.secrets."syncthing/key".path; @@ -92,7 +92,7 @@ in |> lib.mapAttrs ( name: value: { id = value.config.custom.services.syncthing.deviceId; - addresses = [ "tcp://${name}.${tailscaleCfg.domain}:${builtins.toString cfg.syncPort}" ]; + addresses = [ "tcp://${name}.${tailscaleCfg.domain}:${toString cfg.syncPort}" ]; } ); @@ -116,7 +116,7 @@ in ]; options = { - listenAddress = "tcp://0.0.0.0:${builtins.toString cfg.syncPort}"; + listenAddress = "tcp://0.0.0.0:${toString cfg.syncPort}"; globalAnnounceEnabled = false; localAnnounceEnabled = false; relaysEnabled = false; diff --git a/modules/system/services/victorialogs.nix b/modules/system/services/victorialogs.nix index d7a247d..f961d3e 100644 --- a/modules/system/services/victorialogs.nix +++ b/modules/system/services/victorialogs.nix @@ -55,7 +55,7 @@ in __intentionallyOverridingVersion = true; } ); - listenAddress = "localhost:${builtins.toString cfg.port}"; + listenAddress = "localhost:${toString cfg.port}"; extraOptions = [ "-retention.maxDiskSpaceUsageBytes=${cfg.maxDiskSpaceUsage}" ]; }; diff --git a/modules/system/services/victoriametrics.nix b/modules/system/services/victoriametrics.nix index efb7bab..75d26a7 100644 --- a/modules/system/services/victoriametrics.nix +++ b/modules/system/services/victoriametrics.nix @@ -51,7 +51,7 @@ in __intentionallyOverridingVersion = true; } ); - listenAddress = "localhost:${builtins.toString cfg.port}"; + listenAddress = "localhost:${toString cfg.port}"; extraOptions = [ "-selfScrapeInterval=15s" "-selfScrapeJob=victoriametrics"