diff options
author | Linnnus <[email protected]> | 2023-09-10 01:35:14 +0200 |
---|---|---|
committer | Linnnus <[email protected]> | 2023-09-10 01:35:14 +0200 |
commit | 71a517debe25c7be96f1933aa8d543efa0524141 (patch) | |
tree | a6f8716d83bba4d5af44adc3f485dd560cc9cb5b /modules/graphics/default.nix | |
parent | 5dae4d1a1a2a8fd3be3f4c0f6c92b9e74e432bb1 (diff) |
Add graphics module
Diffstat (limited to 'modules/graphics/default.nix')
-rw-r--r-- | modules/graphics/default.nix | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/modules/graphics/default.nix b/modules/graphics/default.nix new file mode 100644 index 0000000..e2b7a86 --- /dev/null +++ b/modules/graphics/default.nix @@ -0,0 +1,36 @@ +# This module configures a basic graphical environment. I use this sometimes for +# ahmed when muhammed is being repaired. + +{ config, lib, pkgs, ... }: + +let + inherit (lib) mkEnableOption mkIf; + + cfg = config.my.modules.graphics; +in +{ + options.my.modules.graphics.enable = mkEnableOption "basic graphical environment"; + + config = mkIf cfg.enable { + services.xserver.enable = true; + + # Match console keyboard layout but swap capslock and escape. + # TODO: Create a custom keymap with esc/capslock swap so console can use it. + services.xserver.layout = config.console.keyMap; + services.xserver.xkbOptions = "caps:swapescape"; + + # Enable touchpad support. + services.xserver.libinput.enable = true; + + services.xserver.windowManager.dwm.enable = true; + + # Enable sound. + sound.enable = true; + hardware.pulseaudio.enable = true; + + environment.systemPackages = with pkgs; [ + st # suckless terminal - dwm is pretty sucky without this + dmenu # application launcher + ]; + }; +} |