Commit graph

3 commits

Author SHA1 Message Date
PerchunPak
d4e4d5cfa3
lib: make toHyprconf support strings and attrs in sections
Adds support for

    section = [
      "abc"
      { a = 123; }
    ];

Which gets generated to

    section=abc

    section {
      a=123
    }

This is very useful with the new windowrule syntax, where you can
create anonymous window rules as strings and named rules as attribute
sets. See <https://wiki.hypr.land/Configuring/Window-Rules/>.
2026-01-02 15:56:43 +01:00
Patrick Widmer
ca922258e1
senpai: switch to scfg format 2024-03-15 11:42:17 +01:00
h7x4
fce9dbfeb4
lib: add generator for KDL
Added a generator for the KDL document language.
This is in order for home-manager to natively generate
the new config format for zellij, as described in nix-community#3364.

There is not a one to one mapping between KDL and nix types,
but attrset translation is heavily based on KDLs JSON-IN-KDL microsyntax.
The exception here is the `_args` and `_props` arguments, which lets you
specify arguments and properties as described in the spec.

See more here:
- https://kdl.dev/
- https://github.com/kdl-org/kdl/blob/main/SPEC.md

The generator also conforms to the interface from the nixpkgs manual:
https://nixos.org/manual/nixpkgs/stable/#sec-generators

Co-authored-by: Gaetan Lepage <gaetan@glepage.com>
2023-03-10 16:48:10 +01:00