1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-20 01:59:45 +01: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;
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