diff --git a/hosts/x86_64-linux/helium.nix b/hosts/x86_64-linux/helium.nix index 9c5c037..e25c689 100644 --- a/hosts/x86_64-linux/helium.nix +++ b/hosts/x86_64-linux/helium.nix @@ -19,7 +19,10 @@ }; wireless.enable = true; }; - hardware.amdLaptop.enable = true; + hardware = { + amdLaptop.enable = true; + monitors.enable = true; + }; platform.hibernate.enable = true; services = { nixCacheClient = { diff --git a/hosts/x86_64-linux/lithium.nix b/hosts/x86_64-linux/lithium.nix index 86cd978..6260a0b 100644 --- a/hosts/x86_64-linux/lithium.nix +++ b/hosts/x86_64-linux/lithium.nix @@ -22,7 +22,10 @@ }; wireless.enable = true; }; - hardware.intelLaptop.enable = true; + hardware = { + intelLaptop.enable = true; + monitors.enable = true; + }; services = { borgClient.enable = true; nixCacheClient = { diff --git a/modules/hardware/monitors.nix b/modules/hardware/monitors.nix new file mode 100644 index 0000000..1ba840d --- /dev/null +++ b/modules/hardware/monitors.nix @@ -0,0 +1,50 @@ +{ config, lib, ... }: +let + cfg = config.custom.hardware.monitors; +in +{ + options.custom.hardware.monitors.enable = lib.mkEnableOption "Autorandr configuration for monitors"; + + config = lib.mkIf cfg.enable { + services.autorandr = { + enable = true; + profiles = { + "lithium-home-docked" = { + fingerprint = { + HDMI-1 = "00ffffffffffff004c2d700d3030303027180103803d23782a5fb1a2574fa2280f5054bfef80714f810081c081809500a9c0b300010108e80030f2705a80b0588a0060592100001e000000fd00184b1e873c000a202020202020000000fc00553238453537300a2020202020000000ff004831414b3530303030300a202001a7020334f04d611203130420221f105f605d5e23090707830100006d030c002000803c20106001020367d85dc401788003e30f0104023a801871382d40582c450060592100001e023a80d072382d40102c458060592100001e011d007251d01e206e28550060592100001e565e00a0a0a029503020350060592100001a00000074"; + eDP-1 = "00ffffffffffff0006af8d4000000000261d0104a51f1178039b85925659902920505400000001010101010101010101010101010101143780b87038244010103e0035ae100000180000000f0000000000000000000000000020000000fe0041554f0a202020202020202020000000fe004231343048414e30342e45200a001d"; + }; + config = { + HDMI-1 = { + crtc = 0; + mode = "3840x2160"; + position = "0x0"; + primary = true; + rate = "60.00"; + }; + eDP-1 = { + crtc = 1; + mode = "1920x1080"; + position = "3840x540"; + rate = "60.05"; + }; + }; + }; + "lithium-mobile" = { + fingerprint = { + eDP-1 = "00ffffffffffff0006af8d4000000000261d0104a51f1178039b85925659902920505400000001010101010101010101010101010101143780b87038244010103e0035ae100000180000000f0000000000000000000000000020000000fe0041554f0a202020202020202020000000fe004231343048414e30342e45200a001d"; + }; + config = { + eDP-1 = { + crtc = 0; + mode = "1920x1080"; + position = "0x0"; + primary = true; + rate = "60.05"; + }; + }; + }; + }; + }; + }; +}