fix: add refreshRateNiri

This commit is contained in:
Nickolaj Jepsen 2025-09-30 07:41:10 +02:00
parent a33c6008d1
commit ad9440eb6a
3 changed files with 13 additions and 6 deletions

View file

@ -6,7 +6,8 @@ _: {
width = 2560;
height = 1440;
};
refreshRate = 144;
refreshRate = 170;
refreshRateNiri = 170.001;
position = {
x = 1920;
y = 0;
@ -18,7 +19,8 @@ _: {
width = 2560;
height = 1440;
};
refreshRate = 144;
refreshRate = 165;
refreshRateNiri = 165.000;
position = {
x = 4480;
y = 0;
@ -31,6 +33,7 @@ _: {
height = 1080;
};
refreshRate = 60;
refreshRateNiri = 60.000;
position = {
x = 0;
y = 0;

View file

@ -296,15 +296,13 @@ in {
};
outputs = lib.mkIf (config.monitors != []) (
lib.listToAttrs (map (monitor: let
refreshRateFloat = lib.mkIf (monitor.refreshRate != null) (builtins.fromJSON "${builtins.toString monitor.refreshRate}.0");
in {
lib.listToAttrs (map (monitor: {
inherit (monitor) name;
value = {
inherit (monitor) position;
mode = {
inherit (monitor.resolution) width height;
refresh = refreshRateFloat;
refresh = monitor.refreshRateNiri or null;
};
focus-at-startup = monitor.name == primaryMonitorName;
transform.rotation =

View file

@ -28,6 +28,12 @@
example = 60;
};
refreshRateNiri = lib.mkOption {
type = lib.types.nullOr lib.types.float;
default = null;
example = 60.0;
};
position.x = lib.mkOption {
type = lib.types.int;
default = 0;