1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-28 09:28:32 +02:00

hyprland: use toKeyValue's indent argument (#4274)

Freshly added in https://github.com/NixOS/nixpkgs/pull/244819
This commit is contained in:
Naïm Favier 2023-07-29 13:12:37 +02:00 committed by GitHub
parent 8d243f7da1
commit 5c23226768
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -186,7 +186,10 @@ in {
''; '';
sections = filterAttrs (n: v: isAttrs v) attrs; 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; allFields = filterAttrs (n: v: !(isAttrs v)) attrs;
importantFields = importantFields =
filterAttrs (n: _: (hasPrefix "$" n) || (hasPrefix "bezier" n)) filterAttrs (n: _: (hasPrefix "$" n) || (hasPrefix "bezier" n))
@ -195,9 +198,7 @@ in {
(mapAttrsToList (n: _: n) importantFields); (mapAttrsToList (n: _: n) importantFields);
in mkFields importantFields in mkFields importantFields
+ concatStringsSep "\n" (mapAttrsToList mkSection sections) + concatStringsSep "\n" (mapAttrsToList mkSection sections)
+ removeSuffix indent (indent + (concatStringsSep '' + mkFields fields;
${indent}'' (splitString "\n" (mkFields fields))));
in lib.mkIf shouldGenerate { in lib.mkIf shouldGenerate {
text = lib.optionalString cfg.systemdIntegration '' 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 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