nix-config/home/wm/default.nix
Bruno BELANYI c56517497a home: wm: use explicit 'enable' options
This is so that I can explicitly enable them if I were to use Wayland
and Sway, given that they should be compatible with both environment.

This also means that putting them in `/home/x/` would a misnomer... Will
revisit this if and when I try out Wayland and sway...
2021-05-08 17:14:13 +02:00

35 lines
724 B
Nix

{ config, lib, ... }:
let
mkRelatedOption = description: relatedWMs:
let
isActivatedWm = wm: config.my.home.wm.windowManager == wm;
in
(lib.mkEnableOption description) // {
default = builtins.any isActivatedWm relatedWMs;
};
in
{
imports = [
./i3.nix
./i3bar.nix
./rofi.nix
];
options.my.home.wm = with lib; {
windowManager = mkOption {
type = with types; nullOr (enum [ "i3" ]);
default = null;
example = "i3";
description = "Which window manager to use for home session";
};
i3bar = {
enable = mkRelatedOption "i3bar configuration" [ "i3" ];
};
rofi = {
enable = mkRelatedOption "rofi menu" [ "i3" ];
};
};
}