summaryrefslogtreecommitdiffstats
path: root/nixos/modules/services/misc
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2024-04-09 14:31:12 +0200
committerGitHub <noreply@github.com>2024-04-09 14:31:12 +0200
commit4cc6ce454d3049ded63959b0c80f4c50dc6f89cc (patch)
treec45201fdbf22421881cf79cc4f2f1fe5f04d1a98 /nixos/modules/services/misc
parent1dd379340a2d99b85a039104291fb878e60cbe0c (diff)
parent476b8c276e2ae4c98efd1d8d759029e170c5ca98 (diff)
Merge pull request #291913 from SuperSandro2000/sddm-wayland-only
Diffstat (limited to 'nixos/modules/services/misc')
-rw-r--r--nixos/modules/services/misc/graphical-desktop.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/graphical-desktop.nix b/nixos/modules/services/misc/graphical-desktop.nix
new file mode 100644
index 000000000000..a88c02e610bf
--- /dev/null
+++ b/nixos/modules/services/misc/graphical-desktop.nix
@@ -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;
+ };
+ };
+}