monitors.nix: added monitor config via modules
This commit is contained in:
parent
59310fd227
commit
7b51187cb9
6 changed files with 102 additions and 72 deletions
|
@ -1,71 +1,73 @@
|
|||
{lib, ...}:
|
||||
with lib; {
|
||||
options.modules.other.system.monitors = mkOption {
|
||||
{lib, ...}: let
|
||||
inherit (lib) mkOption;
|
||||
inherit (lib.types) str submodule int ints number listOf;
|
||||
in {
|
||||
options.modules.system.monitors = mkOption {
|
||||
description = "\n List of monitors to use\n ";
|
||||
default = [];
|
||||
type = with types;
|
||||
types.listOf (submodule {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
description = "Give your monitor a cute name";
|
||||
default = "monitor0(I am lazy)";
|
||||
};
|
||||
device = mkOption {
|
||||
type = types.str;
|
||||
description = "The actual device name of the monitor";
|
||||
};
|
||||
resolution = mkOption {
|
||||
type = types.submodule {
|
||||
options = {
|
||||
x = mkOption {
|
||||
type = types.int;
|
||||
description = "monitor width";
|
||||
default = "1920";
|
||||
};
|
||||
y = mkOption {
|
||||
type = types.int;
|
||||
description = "monitor height";
|
||||
default = "1080";
|
||||
};
|
||||
type = listOf (submodule {
|
||||
options = {
|
||||
name = mkOption {
|
||||
type = str;
|
||||
description = "Give your monitor a cute name";
|
||||
default = "";
|
||||
};
|
||||
device = mkOption {
|
||||
type = str;
|
||||
description = "The actual device name of the monitor";
|
||||
default = "eDP-1";
|
||||
};
|
||||
resolution = mkOption {
|
||||
type = submodule {
|
||||
options = {
|
||||
x = mkOption {
|
||||
type = int;
|
||||
description = "monitor width";
|
||||
default = "1920";
|
||||
};
|
||||
y = mkOption {
|
||||
type = int;
|
||||
description = "monitor height";
|
||||
default = "1080";
|
||||
};
|
||||
};
|
||||
};
|
||||
scale = mkOption {
|
||||
type = types.number;
|
||||
description = "monitor scale";
|
||||
default = 1.0;
|
||||
};
|
||||
refresh_rate = mkOption {
|
||||
type = types.int;
|
||||
description = "monitor refresh rate (in Hz)";
|
||||
default = 60;
|
||||
};
|
||||
position = mkOption {
|
||||
type = types.submodule {
|
||||
options = {
|
||||
x = mkOption {
|
||||
type = types.int;
|
||||
default = 0;
|
||||
};
|
||||
y = mkOption {
|
||||
type = types.int;
|
||||
default = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
description = "absolute monitor posititon";
|
||||
default = {
|
||||
x = 0;
|
||||
y = 0;
|
||||
};
|
||||
};
|
||||
transform = mkOption {
|
||||
type = types.ints.between 0 3;
|
||||
description = "Rotation of the monitor counterclockwise";
|
||||
default = 0;
|
||||
};
|
||||
};
|
||||
});
|
||||
scale = mkOption {
|
||||
type = number;
|
||||
description = "monitor scale";
|
||||
default = 1.0;
|
||||
};
|
||||
refresh_rate = mkOption {
|
||||
type = int;
|
||||
description = "monitor refresh rate (in Hz)";
|
||||
default = 60;
|
||||
};
|
||||
position = mkOption {
|
||||
type = submodule {
|
||||
options = {
|
||||
x = mkOption {
|
||||
type = int;
|
||||
default = 0;
|
||||
};
|
||||
y = mkOption {
|
||||
type = int;
|
||||
default = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
description = "absolute monitor posititon";
|
||||
default = {
|
||||
x = 0;
|
||||
y = 0;
|
||||
};
|
||||
};
|
||||
transform = mkOption {
|
||||
type = ints.between 0 3;
|
||||
description = "Rotation of the monitor counterclockwise";
|
||||
default = 0;
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue