Create an enable option for each module

Fixes #7
This commit is contained in:
Daniel Thwaites 2022-07-25 20:38:43 +01:00
parent cd7b686352
commit a1c4e8179b
No known key found for this signature in database
GPG key ID: D8AFC4BF05670F9D
18 changed files with 498 additions and 385 deletions

View file

@ -1,11 +1,12 @@
{ pkgs, config, lib, ... }:
with lib;
{
options.stylix.targets.feh.enable =
config.lib.stylix.mkEnableTarget
"the desktop background using Feh"
(with config.services.xserver.windowManager; xmonad.enable || i3.enable);
with config.services.xserver.windowManager;
let enable = xmonad.enable || i3.enable;
in {
services.xserver.displayManager.sessionCommands = mkIf enable
config.services.xserver.displayManager.sessionCommands =
lib.mkIf config.stylix.targets.feh.enable
"${pkgs.feh}/bin/feh --no-fehbg --bg-scale ${config.stylix.image}";
}