Skip to content

Commit

Permalink
Require fallback output option
Browse files Browse the repository at this point in the history
  • Loading branch information
rake5k committed Oct 5, 2024
1 parent e869513 commit c144f7e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions home/roles/desktop/xserver/grobi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,28 @@ let

cfg = config.custom.roles.desktop.xserver.grobi;

fallbackRule = {
name = "Fallback";
configure_single = cfg.fallbackOutput;
};

in

{
options = {
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";
};
};
Expand All @@ -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"
Expand Down

0 comments on commit c144f7e

Please sign in to comment.