From 72d4580779e56f11ea04cd2865c1cd9d1416d679 Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Wed, 8 Oct 2025 19:22:41 +0200 Subject: [PATCH] Remove all uses of `with` I decided once again that I don't like `with` --- modules/home/programs/libreoffice.nix | 10 +++++----- modules/system/services/grafana.nix | 11 ++++++++--- modules/system/services/hedgedoc.nix | 12 ++++++++---- modules/system/services/radicale.nix | 10 ++++------ 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/modules/home/programs/libreoffice.nix b/modules/home/programs/libreoffice.nix index e2e7877..75ef872 100644 --- a/modules/home/programs/libreoffice.nix +++ b/modules/home/programs/libreoffice.nix @@ -8,11 +8,11 @@ options.custom.programs.libreoffice.enable = lib.mkEnableOption ""; config = lib.mkIf config.custom.programs.libreoffice.enable { - home.packages = with pkgs; [ - libreoffice - hunspell - hunspellDicts.de_DE - hunspellDicts.en_US + home.packages = [ + pkgs.libreoffice + pkgs.hunspell + pkgs.hunspellDicts.de_DE + pkgs.hunspellDicts.en_US ]; }; } diff --git a/modules/system/services/grafana.nix b/modules/system/services/grafana.nix index f52843d..7185158 100644 --- a/modules/system/services/grafana.nix +++ b/modules/system/services/grafana.nix @@ -113,9 +113,14 @@ in }; declarativePlugins = - with pkgs.grafanaPlugins; - (lib.optional cfg.datasources.victoriametrics.enable victoriametrics-metrics-datasource) - ++ (lib.optional cfg.datasources.victorialogs.enable victoriametrics-logs-datasource); + let + plugins = pkgs.grafanaPlugins; + in + [ + (lib.optional cfg.datasources.victoriametrics.enable plugins.victoriametrics-metrics-datasource) + (lib.optional cfg.datasources.victorialogs.enable plugins.victoriametrics-logs-datasource) + ] + |> lib.concatLists; }; environment.etc = { diff --git a/modules/system/services/hedgedoc.nix b/modules/system/services/hedgedoc.nix index 720298e..9e6db2e 100644 --- a/modules/system/services/hedgedoc.nix +++ b/modules/system/services/hedgedoc.nix @@ -71,10 +71,14 @@ in custom = { services.resticBackups.hedgedoc = lib.mkIf cfg.doBackups { conflictingService = "hedgedoc.service"; - paths = with config.services.hedgedoc.settings; [ - uploadsPath - db.storage - ]; + paths = + let + inherit (config.services.hedgedoc) settings; + in + [ + settings.uploadsPath + settings.db.storage + ]; }; persist.directories = [ dataDir ]; diff --git a/modules/system/services/radicale.nix b/modules/system/services/radicale.nix index dea9776..e0d29d0 100644 --- a/modules/system/services/radicale.nix +++ b/modules/system/services/radicale.nix @@ -53,12 +53,10 @@ in runtimeInputs = [ pkgs.git pkgs.gawk - (pkgs.python3.withPackages ( - python-pkgs: with python-pkgs; [ - dateutil - vobject - ] - )) + (pkgs.python3.withPackages (python-pkgs: [ + python-pkgs.dateutil + python-pkgs.vobject + ])) ]; text = '' username="$1"