nixos-config/modules/xserver.nix

80 lines
2.0 KiB
Nix
Raw Normal View History

2019-08-27 23:41:02 +04:00
{ pkgs, lib, config, ... }:
2020-08-10 01:17:22 +04:00
let
thm = config.lib.base16.theme;
in
2019-09-14 22:12:56 +04:00
with rec {
2020-08-10 01:17:22 +04:00
inherit (config) deviceSpecific;
2019-09-14 22:12:56 +04:00
};
2020-08-10 01:17:22 +04:00
with deviceSpecific; {
2019-08-27 23:41:02 +04:00
services.xserver = {
enable = true;
2020-08-07 23:27:49 +04:00
# TODO: Disable natural scrolling for external mouse
2019-08-27 23:41:02 +04:00
libinput = {
2019-09-14 22:12:56 +04:00
enable = isLaptop;
2019-10-03 12:38:59 +04:00
# sendEventsMode = "disabled-on-external-mouse";
2020-08-04 01:51:37 +04:00
middleEmulation = true;
2019-10-17 00:31:54 +04:00
accelProfile = lib.mkIf (!isLaptop) "flat";
naturalScrolling = true;
2019-08-27 23:41:02 +04:00
};
2019-09-14 22:12:56 +04:00
# 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" ]
2019-08-27 23:41:02 +04:00
else
[ ];
displayManager.lightdm = {
2020-08-06 00:42:43 +04:00
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]
2020-08-10 01:17:22 +04:00
font = "#${thm.font} Mono"
2020-08-06 00:42:43 +04:00
font-size = 14pt
2020-08-10 01:17:22 +04:00
text-color = "#${thm.base0B-hex}"
error-color = "#${thm.base0B-hex}"
2020-08-06 00:42:43 +04:00
background-image = ""
2020-08-10 01:17:22 +04:00
background-color = "#${thm.base00-hex}"
window-color = "#${thm.base01-hex}"
border-color = "#${thm.base0D-hex}"
2020-08-06 00:42:43 +04:00
border-width = 1px
layout-space = 14
2020-08-10 01:17:22 +04:00
password-color = "#${thm.base0B-hex}"
password-background-color = "#${thm.base00-hex}"
2020-08-06 00:42:43 +04:00
'';
};
2019-08-27 23:41:02 +04:00
};
2020-08-04 01:51:37 +04:00
displayManager.autoLogin.enable = !isShared;
displayManager.autoLogin.user = "alukard";
2020-01-15 05:48:39 +04:00
displayManager.defaultSession = "none+i3";
2019-08-27 23:41:02 +04:00
desktopManager.xterm.enable = false;
windowManager.i3 = {
enable = true;
package = pkgs.i3-gaps;
};
layout = "us,ru";
xkbOptions = "grp:win_space_toggle";
};
2019-09-14 22:12:56 +04:00
environment.systemPackages = if video == "amd" then
2019-08-27 23:41:02 +04:00
[ (pkgs.mesa.override { enableRadv = true; }) ]
else
[ ];
}