dot.nix/modules/home/monitors.nix
Chris Toph 894cc4444c Enhances gaming sessions with gamescope commands
- Refactors monitor handling by computing primary monitor parameters
- Introduces new shell scripts for gamescope-run and steam-session integration
- Updates desktop entries to launch Steam and Heroic within gamescope
- Removes deprecated gaming session script from the global gaming configuration
- Simplifies monitor options and adds primary monitor utility in shared libraries
- Adjusts host-specific monitor configurations and README hardware details
2025-06-20 17:41:08 -04:00

73 lines
2.1 KiB
Nix

# The options set using this module are intended for use with logic defined in specific workspace management configurations. For example, see nix-config/home/ta/common/optional/hyprland/
{ lib, config, ... }:
{
options.monitors = lib.mkOption {
type = lib.types.listOf (
lib.types.submodule {
options = {
name = lib.mkOption {
type = lib.types.str;
example = "DP-1";
};
primary = lib.mkOption {
type = lib.types.bool;
default = false;
};
width = lib.mkOption {
type = lib.types.int;
example = 1920;
};
height = lib.mkOption {
type = lib.types.int;
example = 1080;
};
refreshRate = lib.mkOption {
type = lib.types.int;
default = 60;
};
x = lib.mkOption {
type = lib.types.int;
default = 0;
};
y = lib.mkOption {
type = lib.types.int;
default = 0;
};
scale = lib.mkOption {
type = lib.types.number;
default = 1.0;
};
transform = lib.mkOption {
type = lib.types.int;
default = 0;
description = "Screen orientation: 0 = landscape, 1 = portrait left, 2 = portrait right, 3 = landscape flipped";
};
enabled = lib.mkOption {
type = lib.types.bool;
default = true;
};
hdr = lib.mkOption {
type = lib.types.bool;
default = false;
};
vrr = lib.mkOption {
type = lib.types.bool;
description = "Variable Refresh Rate aka Adaptive Sync aka AMD FreeSync.";
default = false;
};
};
}
);
default = [ ];
};
config = {
assertions = [
{
assertion =
((lib.length config.monitors) != 0)
-> ((lib.length (lib.filter (m: m.primary) config.monitors)) == 1);
message = "Exactly one monitor must be set to primary.";
}
];
};
}