autorandr: deterministic and applies for LigthDM

This commit is contained in:
Geoffrey Frogeye 2024-06-09 14:52:31 +02:00
parent f72112f332
commit 7b9d9053bf
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8
6 changed files with 78 additions and 7 deletions

View file

@ -7,7 +7,7 @@
./boot
./ccc
./common.nix
./desktop.nix
./desktop
./dev
./diff
disko.nixosModules.disko

21
os/desktop/autorandr.nix Normal file
View file

@ -0,0 +1,21 @@
{ pkgs, lib, config, ... }:
let
setupScript = "${pkgs.writeShellApplication {
name = "greeter-setup-script";
runtimeInputs = [ pkgs.autorandr ];
text = ''
autorandr --change
'';
}}/bin/greeter-setup-script";
in
{
config = {
services = {
autorandr.enable = true;
xserver.displayManager.lightdm.extraConfig = ''
[Seat:*]
display-setup-script = ${setupScript}
'';
};
};
}

View file

@ -45,4 +45,7 @@
# So we can use gnome3 pinentry flavour
services.dbus.packages = [ pkgs.gcr ];
};
imports = [
./autorandr.nix
];
}