nixos-config/modules/xserver.nix
2020-08-06 00:42:43 +04:00

77 lines
1.9 KiB
Nix

{ pkgs, lib, config, ... }:
with rec {
inherit (config) deviceSpecific themes;
};
with deviceSpecific; with themes; {
services.xserver = {
enable = true;
# enableTCP = true;
libinput = {
enable = isLaptop;
# sendEventsMode = "disabled-on-external-mouse";
middleEmulation = true;
accelProfile = lib.mkIf (!isLaptop) "flat";
naturalScrolling = true;
};
# TODO: make settings for laptops with dGPU
videoDrivers = if video == "amd" then
[ "amdgpu" ]
else if video == "nvidia" then
[ "nvidia" ]
else if video == "intel" then
[ "intel" ]
else
[ ];
displayManager.lightdm = {
greeters.mini = {
enable = isShared;
user = "alukard";
extraConfig = ''
[greeter]
show-password-label = true
password-label-text = Welcome, Alukard
invalid-password-text = Are you sure?
show-input-cursor = false
password-alignment = right
[greeter-theme]
font = "Roboto Mono"
font-size = 14pt
text-color = "${colors.green}"
error-color = "${colors.green}"
background-image = ""
background-color = "${colors.bg}"
window-color = "${colors.dark}"
border-color = "${colors.blue}"
border-width = 1px
layout-space = 14
password-color = "${colors.green}"
password-background-color = "${colors.bg}"
'';
};
};
displayManager.autoLogin.enable = !isShared;
displayManager.autoLogin.user = "alukard";
displayManager.defaultSession = "none+i3";
desktopManager.xterm.enable = false;
windowManager.i3 = {
enable = true;
package = pkgs.i3-gaps;
};
layout = "us,ru";
xkbOptions = "grp:win_space_toggle";
};
environment.systemPackages = if video == "amd" then
[ (pkgs.mesa.override { enableRadv = true; }) ]
else
[ ];
}