-
Notifications
You must be signed in to change notification settings - Fork 0
/
device.nix
65 lines (65 loc) · 2.03 KB
/
device.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Defines device attributes for deciding whether to enable components
# inspired by balsoft
{
config,
options,
lib,
...
}: {
options.modules.device = {
name = lib.mkOption {type = lib.types.str;};
cpu = lib.mkOption {type = lib.types.enum ["amd" "intel"];};
gpu = lib.mkOption {type = lib.types.enum ["amd" "intel" "nvidia"];};
drive = lib.mkOption {type = lib.types.enum ["ssd" "nvme"];};
hasTouchpad = lib.mkOption {
type = lib.types.bool;
default = false;
};
hasFingerprint = lib.mkOption {
type = lib.types.bool;
default = false;
};
supportsBrightness = lib.mkOption {type = lib.types.bool;};
supportsBluetooth = lib.mkOption {type = lib.types.bool;};
bigScreen = lib.mkOption {
type = lib.types.bool;
default = true;
};
displayProtocol = lib.mkOption {type = lib.types.enum ["x11" "wayland"];};
monitors = lib.mkOption {
type = lib.types.attrsOf (lib.types.submodule ({name, ...}: {
options = {
x11_name = lib.mkOption {type = lib.types.str;};
wayland_name = lib.mkOption {type = lib.types.str;};
resolution = lib.mkOption {type = lib.types.str;};
refresh_rate = lib.mkOption {type = lib.types.int;};
position = {
x = lib.mkOption {type = lib.types.int;};
y = lib.mkOption {type = lib.types.int;};
};
modeline = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
};
primary = lib.mkOption {
type = lib.types.bool;
default = false;
};
scale = lib.mkOption {
type = lib.types.float;
default = 0;
};
adaptive_sync = lib.mkOption {
type = lib.types.bool;
default = false;
};
rotation = lib.mkOption {
type = lib.types.enum ["0" "90" "180" "270"];
default = "0";
};
};
}));
description = "monitor settings";
};
};
}