nixos/graphical-desktop: extract generic graphical things from xserver
This is required to fix the keymap in SDDM without X.
This commit is contained in:
parent
d220d8bb6f
commit
5598d81e94
|
@ -710,6 +710,7 @@
|
||||||
./services/misc/gogs.nix
|
./services/misc/gogs.nix
|
||||||
./services/misc/gollum.nix
|
./services/misc/gollum.nix
|
||||||
./services/misc/gpsd.nix
|
./services/misc/gpsd.nix
|
||||||
|
./services/misc/graphical-desktop.nix
|
||||||
./services/misc/greenclip.nix
|
./services/misc/greenclip.nix
|
||||||
./services/misc/guix
|
./services/misc/guix
|
||||||
./services/misc/headphones.nix
|
./services/misc/headphones.nix
|
||||||
|
|
54
nixos/modules/services/misc/graphical-desktop.nix
Normal file
54
nixos/modules/services/misc/graphical-desktop.nix
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
xcfg = config.services.xserver;
|
||||||
|
dmcfg = config.services.displayManager;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = lib.mkIf (xcfg.enable || dmcfg.enable) {
|
||||||
|
# The default max inotify watches is 8192.
|
||||||
|
# Nowadays most apps require a good number of inotify watches,
|
||||||
|
# the value below is used by default on several other distros.
|
||||||
|
boot.kernel.sysctl = {
|
||||||
|
"fs.inotify.max_user_instances" = lib.mkDefault 524288;
|
||||||
|
"fs.inotify.max_user_watches" = lib.mkDefault 524288;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment = {
|
||||||
|
# localectl looks into 00-keyboard.conf
|
||||||
|
etc."X11/xorg.conf.d/00-keyboard.conf".text = ''
|
||||||
|
Section "InputClass"
|
||||||
|
Identifier "Keyboard catchall"
|
||||||
|
MatchIsKeyboard "on"
|
||||||
|
Option "XkbModel" "${xcfg.xkb.model}"
|
||||||
|
Option "XkbLayout" "${xcfg.xkb.layout}"
|
||||||
|
Option "XkbOptions" "${xcfg.xkb.options}"
|
||||||
|
Option "XkbVariant" "${xcfg.xkb.variant}"
|
||||||
|
EndSection
|
||||||
|
'';
|
||||||
|
systemPackages = with pkgs; [
|
||||||
|
nixos-icons # needed for gnome and pantheon about dialog, nixos-manual and maybe more
|
||||||
|
xdg-utils
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
fonts.enableDefaultPackages = lib.mkDefault true;
|
||||||
|
|
||||||
|
hardware.opengl.enable = lib.mkDefault true;
|
||||||
|
|
||||||
|
programs.gnupg.agent.pinentryPackage = lib.mkOverride 1100 pkgs.pinentry-gnome3;
|
||||||
|
|
||||||
|
systemd.defaultUnit = lib.mkIf (xcfg.autorun || dmcfg.enable) "graphical.target";
|
||||||
|
|
||||||
|
xdg = {
|
||||||
|
autostart.enable = true;
|
||||||
|
menus.enable = true;
|
||||||
|
mime.enable = true;
|
||||||
|
icons.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -651,8 +651,6 @@ in
|
||||||
|| config.services.greetd.enable);
|
|| config.services.greetd.enable);
|
||||||
in mkIf (default) (mkDefault true);
|
in mkIf (default) (mkDefault true);
|
||||||
|
|
||||||
hardware.opengl.enable = mkDefault true;
|
|
||||||
|
|
||||||
services.xserver.videoDrivers = mkIf (cfg.videoDriver != null) [ cfg.videoDriver ];
|
services.xserver.videoDrivers = mkIf (cfg.videoDriver != null) [ cfg.videoDriver ];
|
||||||
|
|
||||||
# FIXME: somehow check for unknown driver names.
|
# FIXME: somehow check for unknown driver names.
|
||||||
|
@ -686,19 +684,6 @@ in
|
||||||
# -xkbdir command line option does not seems to be passed to xkbcomp.
|
# -xkbdir command line option does not seems to be passed to xkbcomp.
|
||||||
"X11/xkb".source = "${cfg.xkb.dir}";
|
"X11/xkb".source = "${cfg.xkb.dir}";
|
||||||
})
|
})
|
||||||
# localectl looks into 00-keyboard.conf
|
|
||||||
//{
|
|
||||||
"X11/xorg.conf.d/00-keyboard.conf".text = ''
|
|
||||||
Section "InputClass"
|
|
||||||
Identifier "Keyboard catchall"
|
|
||||||
MatchIsKeyboard "on"
|
|
||||||
Option "XkbModel" "${cfg.xkb.model}"
|
|
||||||
Option "XkbLayout" "${cfg.xkb.layout}"
|
|
||||||
Option "XkbOptions" "${cfg.xkb.options}"
|
|
||||||
Option "XkbVariant" "${cfg.xkb.variant}"
|
|
||||||
EndSection
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
# Needed since 1.18; see https://bugs.freedesktop.org/show_bug.cgi?id=89023#c5
|
# Needed since 1.18; see https://bugs.freedesktop.org/show_bug.cgi?id=89023#c5
|
||||||
// (let cfgPath = "X11/xorg.conf.d/10-evdev.conf"; in
|
// (let cfgPath = "X11/xorg.conf.d/10-evdev.conf"; in
|
||||||
{
|
{
|
||||||
|
@ -718,31 +703,12 @@ in
|
||||||
xorg.xprop
|
xorg.xprop
|
||||||
xorg.xauth
|
xorg.xauth
|
||||||
pkgs.xterm
|
pkgs.xterm
|
||||||
pkgs.xdg-utils
|
|
||||||
xorg.xf86inputevdev.out # get evdev.4 man page
|
xorg.xf86inputevdev.out # get evdev.4 man page
|
||||||
pkgs.nixos-icons # needed for gnome and pantheon about dialog, nixos-manual and maybe more
|
|
||||||
] config.services.xserver.excludePackages
|
] config.services.xserver.excludePackages
|
||||||
++ optional (elem "virtualbox" cfg.videoDrivers) xorg.xrefresh;
|
++ optional (elem "virtualbox" cfg.videoDrivers) xorg.xrefresh;
|
||||||
|
|
||||||
environment.pathsToLink = [ "/share/X11" ];
|
environment.pathsToLink = [ "/share/X11" ];
|
||||||
|
|
||||||
xdg = {
|
|
||||||
autostart.enable = true;
|
|
||||||
menus.enable = true;
|
|
||||||
mime.enable = true;
|
|
||||||
icons.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# The default max inotify watches is 8192.
|
|
||||||
# Nowadays most apps require a good number of inotify watches,
|
|
||||||
# the value below is used by default on several other distros.
|
|
||||||
boot.kernel.sysctl."fs.inotify.max_user_instances" = mkDefault 524288;
|
|
||||||
boot.kernel.sysctl."fs.inotify.max_user_watches" = mkDefault 524288;
|
|
||||||
|
|
||||||
programs.gnupg.agent.pinentryPackage = lib.mkOverride 1100 pkgs.pinentry-gnome3;
|
|
||||||
|
|
||||||
systemd.defaultUnit = mkIf cfg.autorun "graphical.target";
|
|
||||||
|
|
||||||
systemd.services.display-manager =
|
systemd.services.display-manager =
|
||||||
{ description = "Display Manager";
|
{ description = "Display Manager";
|
||||||
|
|
||||||
|
@ -902,7 +868,6 @@ in
|
||||||
${cfg.extraConfig}
|
${cfg.extraConfig}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
fonts.enableDefaultPackages = mkDefault true;
|
|
||||||
fonts.packages = [
|
fonts.packages = [
|
||||||
(if cfg.upscaleDefaultCursor then fontcursormisc_hidpi else pkgs.xorg.fontcursormisc)
|
(if cfg.upscaleDefaultCursor then fontcursormisc_hidpi else pkgs.xorg.fontcursormisc)
|
||||||
pkgs.xorg.fontmiscmisc
|
pkgs.xorg.fontmiscmisc
|
||||||
|
|
Loading…
Reference in New Issue
Block a user