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

View file

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

View file

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