From 5c23226768abd3402636f4d3c65aea8450997102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Favier?= Date: Sat, 29 Jul 2023 13:12:37 +0200 Subject: [PATCH] hyprland: use `toKeyValue`'s `indent` argument (#4274) Freshly added in https://github.com/NixOS/nixpkgs/pull/244819 --- modules/services/window-managers/hyprland.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/services/window-managers/hyprland.nix b/modules/services/window-managers/hyprland.nix index 447421be2..41ceb356c 100644 --- a/modules/services/window-managers/hyprland.nix +++ b/modules/services/window-managers/hyprland.nix @@ -186,7 +186,10 @@ in { ''; sections = filterAttrs (n: v: isAttrs v) attrs; - mkFields = generators.toKeyValue { listsAsDuplicateKeys = true; }; + mkFields = generators.toKeyValue { + listsAsDuplicateKeys = true; + inherit indent; + }; allFields = filterAttrs (n: v: !(isAttrs v)) attrs; importantFields = filterAttrs (n: _: (hasPrefix "$" n) || (hasPrefix "bezier" n)) @@ -195,9 +198,7 @@ in { (mapAttrsToList (n: _: n) importantFields); in mkFields importantFields + concatStringsSep "\n" (mapAttrsToList mkSection sections) - + removeSuffix indent (indent + (concatStringsSep '' - - ${indent}'' (splitString "\n" (mkFields fields)))); + + mkFields fields; in lib.mkIf shouldGenerate { text = lib.optionalString cfg.systemdIntegration '' exec-once = ${pkgs.dbus}/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY HYPRLAND_INSTANCE_SIGNATURE XDG_CURRENT_DESKTOP && systemctl --user start hyprland-session.target