summaryrefslogtreecommitdiff
path: root/modules/nixos/graphics/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nixos/graphics/default.nix')
-rw-r--r--modules/nixos/graphics/default.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/modules/nixos/graphics/default.nix b/modules/nixos/graphics/default.nix
new file mode 100644
index 0000000..f54d043
--- /dev/null
+++ b/modules/nixos/graphics/default.nix
@@ -0,0 +1,37 @@
+# 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.modules.graphics;
+in {
+ options.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
+ ];
+ };
+}