refactor(niri): base niri.outputs on config.monitors

This commit is contained in:
Nickolaj Jepsen 2025-08-23 18:42:54 +02:00
parent ba100b98ba
commit 1bed4d5d9f
10 changed files with 133 additions and 119 deletions

View file

@ -1,5 +1,9 @@
# https://github.com/ChangeCaps/nixos-config/tree/0cec356abc0e46ca6ba27b3cf01cd51273bd4a69
{lib, ...}: {
{
lib,
config,
...
}: {
options.monitors = lib.mkOption {
type = lib.types.listOf (lib.types.submodule {
options = {
@ -9,10 +13,13 @@
example = "DP-1";
};
resolution = lib.mkOption {
type = lib.types.nullOr lib.types.str;
resolution.width = lib.mkOption {
type = lib.types.nullOr lib.types.int;
default = null;
};
resolution.height = lib.mkOption {
type = lib.types.nullOr lib.types.int;
default = null;
example = "1920x1080";
};
refreshRate = lib.mkOption {
@ -21,9 +28,13 @@
example = 60;
};
position = lib.mkOption {
type = lib.types.str;
default = "0x0";
position.x = lib.mkOption {
type = lib.types.int;
default = 0;
};
position.y = lib.mkOption {
type = lib.types.int;
default = 0;
};
scale = lib.mkOption {