From aaebbc8e6cc7695ed645d491b07dec0806dd9d1f Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 4 Jan 2023 10:57:52 +0100 Subject: [PATCH] i3: remove i3/i3-gaps distinction --- .../services/window-managers/i3-sway/i3.nix | 17 ++------------- .../window-managers/i3-sway/lib/options.nix | 21 +++++-------------- 2 files changed, 7 insertions(+), 31 deletions(-) diff --git a/modules/services/window-managers/i3-sway/i3.nix b/modules/services/window-managers/i3-sway/i3.nix index dc4ffc2f1faa..453367cee6a5 100644 --- a/modules/services/window-managers/i3-sway/i3.nix +++ b/modules/services/window-managers/i3-sway/i3.nix @@ -9,7 +9,6 @@ let commonOptions = import ./lib/options.nix { inherit config lib cfg pkgs; moduleName = "i3"; - isGaps = cfg.package == pkgs.i3-gaps; }; configModule = types.submodule { @@ -209,16 +208,7 @@ in { xsession.windowManager.i3 = { enable = mkEnableOption "i3 window manager"; - package = mkOption { - type = types.package; - default = pkgs.i3; - defaultText = literalExpression "pkgs.i3"; - example = literalExpression "pkgs.i3-gaps"; - description = '' - i3 package to use. - If 'i3.config.gaps' settings are specified, 'pkgs.i3-gaps' will be set as a default package. - ''; - }; + package = mkPackageOption pkgs "i3" { }; config = mkOption { type = types.nullOr configModule; @@ -260,10 +250,7 @@ in { }; } - (mkIf (cfg.config != null) { - xsession.windowManager.i3.package = - mkDefault (if (cfg.config.gaps != null) then pkgs.i3-gaps else pkgs.i3); - }) + (mkIf (cfg.config != null) { xsession.windowManager.i3.package = pkgs.i3; }) (mkIf (cfg.config != null) { warnings = (optional (isList cfg.config.fonts) diff --git a/modules/services/window-managers/i3-sway/lib/options.nix b/modules/services/window-managers/i3-sway/lib/options.nix index 600121e0da48..81fcf5e0bb31 100644 --- a/modules/services/window-managers/i3-sway/lib/options.nix +++ b/modules/services/window-managers/i3-sway/lib/options.nix @@ -1,5 +1,4 @@ -{ config, lib, moduleName, cfg, pkgs, capitalModuleName ? moduleName -, isGaps ? true }: +{ config, lib, moduleName, cfg, pkgs, capitalModuleName ? moduleName }: with lib; @@ -158,7 +157,7 @@ let defaultText = "i3bar"; description = "Command that will be used to start a bar."; example = if isI3 then - "\${pkgs.i3-gaps}/bin/i3bar -t" + "\${pkgs.i3}/bin/i3bar -t" else "\${pkgs.waybar}/bin/waybar"; }; @@ -389,11 +388,7 @@ in { options = { titlebar = mkOption { type = types.bool; - default = !isGaps; - defaultText = if isI3 then - "xsession.windowManager.i3.package != nixpkgs.i3-gaps (titlebar should be disabled for i3-gaps)" - else - "false"; + default = true; description = "Whether to show window titlebars."; }; @@ -432,11 +427,7 @@ in { options = { titlebar = mkOption { type = types.bool; - default = !isGaps; - defaultText = if isI3 then - "xsession.windowManager.i3.package != nixpkgs.i3-gaps (titlebar should be disabled for i3-gaps)" - else - "false"; + default = true; description = "Whether to show floating window titlebars."; }; @@ -826,10 +817,8 @@ in { }; }); default = null; - description = if isSway then '' + description = '' Gaps related settings. - '' else '' - i3Gaps related settings. The i3-gaps package must be used for these features to work. ''; };