Skip to content

Support for extra config inside niri.settings #825

@Doosty

Description

@Doosty

I notice that niri development moves quite fast and it is understandable that you cannot always keep up with adding all of the newest features to niri-flake right away. Currently i have my niri configured through niri.settings and if i want to add any non-declared features like shadows or tabs i get an error. I assume i could instead use niri.config, however that overwrites the entirety of my niri.settings, disables stylix support and doesnt offer nix validation if i understand correctly.

Many nix modules allow for some kind of extraConfig option that takes in a raw string which is then appended to the end of the generated config file. Im guessing it is not so simple with kdl, but perhaps some kind of inline raw string function could be allowed similar to spawn so we could do something like this anywhere inside settings attribute set:

programs.niri.settings = {
  # ...
  layout.shadows = unsafeRawString ''
    on
    softness 30
    spread 5
    offset x=0 y=5
    draw-behind-window true
    color "#00000070"
  '';
  binds = { 
    "${Mod}+Shift+S" = unsafeRawString ''
      hotkey-overlay-title="<b>Toggle</b> <span foreground='red'>Dark</span>/Light Style" { spawn "some-script.sh"; }
    '';
    # ...
  };
};

This is just an imaginary snippet but im curious what are your thoughts. Or maybe im missing something that already exists?

EDIT: perhaps even allow mixing your existing niri.config kdl format (nodes/leafs) inside niri.settings ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions