snowhawk: move monitor config to hardware

sh-initrd-on-root
Zynh Ludwig 2024-09-19 03:27:20 -07:00
parent 217f09f7ef
commit a87f8feb1a
2 changed files with 41 additions and 33 deletions

View File

@ -1,5 +1,40 @@
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
let
default-monitors = pkgs.writeXrandrScriptBin "default-monitors" {
DP-0 = {
primary = true;
mode = "1920x1080";
pos = "1920x0";
rotate = "normal";
};
HDMI-0 = {
mode = "1920x1080";
pos = "0x0";
rotate = "normal";
};
};
tv-on = pkgs.writeXrandrScriptBin "tv-on" {
DP-0 = {
primary = true;
mode = "1920x1080";
pos = "1920x1080";
rotate = "normal";
};
HDMI-0 = {
mode = "1920x1080";
pos = "0x1080";
rotate = "normal";
};
HDMI-1 = {
mode = "1920x1080";
pos = "1920x0";
rotate = "normal";
};
};
in
{ {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
@ -38,21 +73,13 @@
services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ]; services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ];
services.xserver.dpi = lib.mkDefault 96; services.xserver.dpi = lib.mkDefault 96;
environment.systemPackages = [
default-monitors
tv-on
];
systemd.user.services.screenlayout = { systemd.user.services.screenlayout = {
script = lib.getExe script = lib.getExe default-monitors;
(pkgs.writeXrandrScriptBin "default-monitors" {
DP-0 = {
primary = true;
mode = "1920x1080";
pos = "1920x0";
rotate = "normal";
};
HDMI-0 = {
mode = "1920x1080";
pos = "0x0";
rotate = "normal";
};
});
wantedBy = [ "graphical-session.target" ]; wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ]; partOf = [ "graphical-session.target" ];
}; };

View File

@ -70,25 +70,6 @@
systemctl suspend systemctl suspend
'') '')
(writeXrandrScriptBin "tv-on" {
DP-0 = {
primary = true;
mode = "1920x1080";
pos = "1920x1080";
rotate = "normal";
};
HDMI-0 = {
mode = "1920x1080";
pos = "0x1080";
rotate = "normal";
};
HDMI-1 = {
mode = "1920x1080";
pos = "1920x0";
rotate = "normal";
};
})
feh feh
imagemagick imagemagick
uhk-agent uhk-agent