1 { config, lib, pkgs, ... }:
6 cfg = config.services.xserver.windowManager.i3;
10 options.services.xserver.windowManager.i3 = {
11 enable = mkEnableOption (lib.mdDoc "i3 window manager");
13 configFile = mkOption {
15 type = with types; nullOr path;
16 description = lib.mdDoc ''
17 Path to the i3 configuration file.
18 If left at the default value, $HOME/.i3/config will be used.
22 extraSessionCommands = mkOption {
25 description = lib.mdDoc ''
26 Shell commands executed just before i3 is started.
33 defaultText = literalExpression "pkgs.i3";
34 example = literalExpression "pkgs.i3-gaps";
35 description = lib.mdDoc ''
40 extraPackages = mkOption {
41 type = with types; listOf package;
42 default = with pkgs; [ dmenu i3status i3lock ];
43 defaultText = literalExpression ''
50 description = lib.mdDoc ''
51 Extra packages to be installed system wide.
56 config = mkIf cfg.enable {
57 services.xserver.windowManager.session = [{
60 ${cfg.extraSessionCommands}
62 ${cfg.package}/bin/i3 ${optionalString (cfg.configFile != null)
68 environment.systemPackages = [ cfg.package ] ++ cfg.extraPackages;
69 environment.etc."i3/config" = mkIf (cfg.configFile != null) {
70 source = cfg.configFile;
75 (mkRemovedOptionModule [ "services" "xserver" "windowManager" "i3-gaps" "enable" ]
76 "Use services.xserver.windowManager.i3.enable and set services.xserver.windowManager.i3.package to pkgs.i3-gaps to use i3-gaps.")