From c144f7ea7e7d0f57898b2c0cccee6d46e5096d78 Mon Sep 17 00:00:00 2001 From: Christian Harke Date: Sat, 5 Oct 2024 11:39:57 +0200 Subject: [PATCH] Require fallback output option --- home/roles/desktop/xserver/grobi/default.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/home/roles/desktop/xserver/grobi/default.nix b/home/roles/desktop/xserver/grobi/default.nix index 1769553b..e19a11f9 100644 --- a/home/roles/desktop/xserver/grobi/default.nix +++ b/home/roles/desktop/xserver/grobi/default.nix @@ -6,6 +6,11 @@ let cfg = config.custom.roles.desktop.xserver.grobi; + fallbackRule = { + name = "Fallback"; + configure_single = cfg.fallbackOutput; + }; + in { @@ -13,9 +18,16 @@ in custom.roles.desktop.xserver.grobi = { enable = mkEnableOption "Grobi config"; + fallbackOutput = mkOption { + type = types.str; + description = "Fallback output if no rule matches"; + }; + rules = mkOption { type = with types; listOf attrs; - default = [ ]; + default = [ + fallbackRule + ]; description = "Grobi rules"; }; }; @@ -30,8 +42,8 @@ in programs.feh.enable = true; services.grobi = { - inherit (cfg) rules; enable = true; + rules = cfg.rules ++ [ fallbackRule ]; executeAfter = [ "${lib.getExe pkgs.feh} --no-fehbg --bg-fill --randomize ${inputs.wallpapers}" "${pkgs.polybar}/bin/polybar-msg cmd restart"