2024-12-30 17:33:20 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.custom.desktops.niri.output;
|
|
|
|
in {
|
|
|
|
options.custom.desktops.niri.output = {
|
|
|
|
enable = mkOption {default = false;};
|
|
|
|
connectors = mkOption {default = [];};
|
2025-01-02 12:01:56 -06:00
|
|
|
disabled = mkOption {default = [];};
|
2024-12-30 17:33:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home-manager.sharedModules = [
|
|
|
|
{
|
|
|
|
# https://github.com/YaLTeR/niri/wiki/Configuration:-Outputs
|
2025-01-01 11:46:16 -06:00
|
|
|
# https://github.com/sodiboo/niri-flake/blob/main/docs.md#programsnirisettingsoutputs
|
2024-12-31 12:43:57 -06:00
|
|
|
#?? niri msg outputs
|
2024-12-30 17:33:20 +00:00
|
|
|
programs.niri.settings.outputs = listToAttrs (forEach cfg.connectors (connector: {
|
2025-01-02 12:01:56 -06:00
|
|
|
name = connector;
|
2024-12-30 17:33:20 +00:00
|
|
|
|
2025-01-02 12:01:56 -06:00
|
|
|
value = {
|
|
|
|
background-color = "#073642";
|
2024-12-30 17:33:20 +00:00
|
|
|
|
2025-01-02 12:01:56 -06:00
|
|
|
mode = with config.custom; {
|
|
|
|
inherit width height;
|
|
|
|
refresh = refresh + 0.0; # Convert to float
|
|
|
|
};
|
2024-12-30 17:33:20 +00:00
|
|
|
|
2025-01-02 12:01:56 -06:00
|
|
|
scale = config.custom.scale;
|
|
|
|
variable-refresh-rate = mkIf config.custom.vrr "on-demand"; #!! Requires window-rule
|
|
|
|
};
|
|
|
|
})
|
|
|
|
++ (forEach cfg.disabled (connector: {
|
|
|
|
name = connector;
|
|
|
|
value = {enable = false;};
|
|
|
|
})));
|
2024-12-30 17:33:20 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|