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, ... }:
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") ];
@ -38,21 +73,13 @@
services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ];
services.xserver.dpi = lib.mkDefault 96;
environment.systemPackages = [
default-monitors
tv-on
];
systemd.user.services.screenlayout = {
script = lib.getExe
(pkgs.writeXrandrScriptBin "default-monitors" {
DP-0 = {
primary = true;
mode = "1920x1080";
pos = "1920x0";
rotate = "normal";
};
HDMI-0 = {
mode = "1920x1080";
pos = "0x0";
rotate = "normal";
};
});
script = lib.getExe default-monitors;
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
};

View File

@ -70,25 +70,6 @@
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
imagemagick
uhk-agent