modules/laptop-config: refactor

This commit is contained in:
Max Headroom 2024-07-09 15:12:26 +02:00
parent c756aa886b
commit 502ed1151a

View file

@ -1,36 +1,15 @@
{ pkgs, lib, ... }:
{ lib, ... }:
{
programs.dconf.profiles.gdm = lib.mkForce (let
customDconf = pkgs.writeTextFile {
name = "gdm-dconf-touchpad";
destination = "/dconf/gdm-custom";
text = ''
[org/gnome/desktop/peripherals/touchpad]
edge-scrolling-enabled=false
natural-scroll=false
speed=0.375
tap-to-click=true
two-finger-scrolling-enabled=true
'';
};
customDconfDb = pkgs.stdenv.mkDerivation {
name = "gdm-dconf-db";
buildCommand = ''
${pkgs.dconf}/bin/dconf compile $out ${customDconf}/dconf
'';
};
in pkgs.stdenv.mkDerivation {
name = "dconf-gdm-profile";
buildCommand = with { gdm = pkgs.gnome.gdm; }; ''
# Check that the GDM profile starts with what we expect.
if [ $(head -n 1 ${gdm}/share/dconf/profile/gdm) != "user-db:user" ]; then
echo "GDM dconf profile changed, please update gdm.nix"
exit 1
fi
# Insert our custom DB behind it.
sed '2ifile-db:${customDconfDb}' ${gdm}/share/dconf/profile/gdm > $out
'';
});
programs.dconf.profiles.gdm.databases = [
{
settings."org/gnome/desktop/peripherals/touchpad" = {
edge-scrolling-enabled = false;
natural-scroll = false;
speed= lib.gvariant.mkDouble 0.375;
tap-to-click = true;
two-finger-scrolling-enabled = true;
};
}
];
}