home

My NixOS systems configurations.
Log | Files | Refs | LICENSE

wayland.nix (925B)


      1 { config, lib, pkgs, ... }:
      2 let
      3   inherit (lib) mkIf mkEnableOption mkDefault mkForce versionOlder;
      4   cfg = config.modules.desktop.wayland;
      5   stable = versionOlder config.system.nixos.release "24.05";
      6 in
      7 {
      8   options = {
      9     modules.desktop.wayland = {
     10       enable = mkEnableOption "Enable wayland desktop";
     11     };
     12   };
     13   config = mkIf cfg.enable {
     14     # Enable desktop module if not already.
     15     modules.desktop.enable = true;
     16     # Force disable xorg desktop module
     17     modules.desktop.xorg.enable = mkForce false;
     18     # Hardware Support for Wayland Sway, …
     19     hardware = {
     20       # graphics
     21       opengl = {
     22         enable = true;
     23       };
     24     };
     25     services = {} // (if stable then {} else {
     26       libinput = {
     27 	touchpad = {
     28 	  disableWhileTyping = true;
     29 	  additionalOptions = ''
     30 	    Option "Ignore" "on"
     31 	  '';
     32 	};
     33       };
     34     });
     35     environment.systemPackages = with pkgs; [
     36       qogir-icon-theme
     37     ];
     38   };
     39 }