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...
This commit is contained in:
parent
38a475d35d
commit
c56517497a
|
@ -1,4 +1,13 @@
|
|||
{ lib, ... }:
|
||||
{ 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
|
||||
|
@ -13,5 +22,13 @@
|
|||
example = "i3";
|
||||
description = "Which window manager to use for home session";
|
||||
};
|
||||
|
||||
i3bar = {
|
||||
enable = mkRelatedOption "i3bar configuration" [ "i3" ];
|
||||
};
|
||||
|
||||
rofi = {
|
||||
enable = mkRelatedOption "rofi menu" [ "i3" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
isEnabled = config.my.home.wm.windowManager == "i3";
|
||||
cfg = config.my.home.wm.i3bar;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf isEnabled {
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = with pkgs; [
|
||||
alsaUtils # Used by `sound` block
|
||||
lm_sensors # Used by `temperature` block
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
isEnabled = config.my.home.wm.windowManager == "i3";
|
||||
cfg = config.my.home.wm.rofi;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf isEnabled {
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
|
||||
|
|
Loading…
Reference in a new issue