From 892de67a9f64d0b0cdb023d830a019d8feec0a57 Mon Sep 17 00:00:00 2001 From: Jakub Stachurski Date: Wed, 19 Nov 2025 21:02:52 +0100 Subject: Nix fmt --- modules/desktop/default.nix | 73 ++++++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 34 deletions(-) (limited to 'modules/desktop/default.nix') diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 4719b5d..be082bc 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -1,50 +1,55 @@ -{pkgs, lib, config,...}: -with lib; - let - wmMeta = config.addons.desktop.wmMeta; +{ + pkgs, + lib, + config, + ... +}: +with lib; +let + wmMeta = config.addons.desktop.wmMeta; - # Gets all the vm's that are enabled and checks which protocols are used + # Gets all the vm's that are enabled and checks which protocols are used enabledWMs = (filter (wm: wm.enable) (attrValues wmMeta)); - protos = (unique (map (wm: wm.protocol) enabledWMs)); - desktopEnabled = protos != []; - x11Enabled = elem "x11" protos; - waylandEnabled = elem "wayland" protos; + protos = (unique (map (wm: wm.protocol) enabledWMs)); + desktopEnabled = protos != [ ]; + x11Enabled = elem "x11" protos; + waylandEnabled = elem "wayland" protos; - -in { +in +{ imports = [ ./common.nix ./x11.nix ./wayland.nix ./wms ./steam.nix - ]; + ]; options.addons.desktop = with types; { - wmMeta = mkOption { - type = attrsOf (submodule { - options = { - enable = mkOption { - type = bool; - default = false; - }; - protocol = mkOption { - type = str; - description = "Used display protocol (x11 or wayland)"; - }; + wmMeta = mkOption { + type = attrsOf (submodule { + options = { + enable = mkOption { + type = bool; + default = false; + }; + protocol = mkOption { + type = str; + description = "Used display protocol (x11 or wayland)"; }; - }); - default = {}; - description = "Window manager metadata used for determining which protocol to enable."; - }; + }; + }); + default = { }; + description = "Window manager metadata used for determining which protocol to enable."; + }; - # enable = lib.mkEnableOption "Whenever any desktop environment is enabled."; - # x11.enable = lib.mkEnableOption "Whenever x11 desktop environment is enabled."; - # wayland.enable = lib.mkEnableOption "Whenever wayland desktop environment is enabled."; + # enable = lib.mkEnableOption "Whenever any desktop environment is enabled."; + # x11.enable = lib.mkEnableOption "Whenever x11 desktop environment is enabled."; + # wayland.enable = lib.mkEnableOption "Whenever wayland desktop environment is enabled."; }; - config.addons.desktop = { - enable = desktopEnabled; - x11.enable = x11Enabled; - wayland.enable = waylandEnabled; + config.addons.desktop = { + enable = desktopEnabled; + x11.enable = x11Enabled; + wayland.enable = waylandEnabled; }; } -- cgit v1.3.1