From d69c701a9b390449800f1d440f1fc8ecf9018295 Mon Sep 17 00:00:00 2001 From: Wisehh Date: Sun, 1 Jan 2023 20:08:26 -0500 Subject: [PATCH 1/4] feh: Add package option --- modules/programs/feh.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/programs/feh.nix b/modules/programs/feh.nix index e098342b53c7..1f1980fbf8b2 100644 --- a/modules/programs/feh.nix +++ b/modules/programs/feh.nix @@ -13,7 +13,8 @@ let enabled = filterAttrs (n: v: v != null) bindings; disabled = filterAttrs (n: v: v == null) bindings; render = mapAttrsToList renderBinding; - in concatStringsSep "\n" (render disabled ++ render enabled); + in + concatStringsSep "\n" (render disabled ++ render enabled); renderBinding = func: key: if key == null then @@ -23,10 +24,18 @@ let else "${func} ${toString key}"; -in { +in +{ options.programs.feh = { enable = mkEnableOption "feh - a fast and light image viewer"; + package = mkOption { + type = types.package; + default = pkgs.feh; + defaultText = literalExpression "pkgs.feh"; + description = "The feh package to use"; + }; + buttons = mkOption { default = { }; type = with types; bindingsOf (either str int); @@ -69,7 +78,7 @@ in { "To disable a keybinding, use `null` instead of an empty string."; }]; - home.packages = [ pkgs.feh ]; + home.packages = [ cfg.package ]; xdg.configFile."feh/buttons" = mkIf (cfg.buttons != { }) { text = renderBindings cfg.buttons + "\n"; }; From 5b61a1ad86bc07a7f229aa62609f93d295f71d3e Mon Sep 17 00:00:00 2001 From: Wisehh Date: Sun, 1 Jan 2023 20:23:41 -0500 Subject: [PATCH 2/4] feh: Add package option --- modules/programs/feh.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/programs/feh.nix b/modules/programs/feh.nix index 1f1980fbf8b2..c0c8af6bb000 100644 --- a/modules/programs/feh.nix +++ b/modules/programs/feh.nix @@ -13,8 +13,7 @@ let enabled = filterAttrs (n: v: v != null) bindings; disabled = filterAttrs (n: v: v == null) bindings; render = mapAttrsToList renderBinding; - in - concatStringsSep "\n" (render disabled ++ render enabled); + in concatStringsSep "\n" (render disabled ++ render enabled); renderBinding = func: key: if key == null then @@ -24,8 +23,7 @@ let else "${func} ${toString key}"; -in -{ +in { options.programs.feh = { enable = mkEnableOption "feh - a fast and light image viewer"; From 41e7722778c4689b555f41731683e90681ac3150 Mon Sep 17 00:00:00 2001 From: Wiseh <55264980+Wisehh@users.noreply.github.com> Date: Sun, 1 Jan 2023 20:54:23 -0500 Subject: [PATCH 3/4] feh: Add package option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add sugested change Co-authored-by: Naïm Favier --- modules/programs/feh.nix | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/modules/programs/feh.nix b/modules/programs/feh.nix index c0c8af6bb000..311d887b002b 100644 --- a/modules/programs/feh.nix +++ b/modules/programs/feh.nix @@ -27,12 +27,7 @@ in { options.programs.feh = { enable = mkEnableOption "feh - a fast and light image viewer"; - package = mkOption { - type = types.package; - default = pkgs.feh; - defaultText = literalExpression "pkgs.feh"; - description = "The feh package to use"; - }; + package = mkPackageOption pkgs "feh"; buttons = mkOption { default = { }; From e5226931536527bd9848b9e13c55c24b34614561 Mon Sep 17 00:00:00 2001 From: Wiseh <55264980+Wisehh@users.noreply.github.com> Date: Mon, 2 Jan 2023 14:04:56 -0500 Subject: [PATCH 4/4] feh: Add package option Add commit suggestion Co-authored-by: Sumner Evans --- modules/programs/feh.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/feh.nix b/modules/programs/feh.nix index 311d887b002b..15aac1751846 100644 --- a/modules/programs/feh.nix +++ b/modules/programs/feh.nix @@ -27,7 +27,7 @@ in { options.programs.feh = { enable = mkEnableOption "feh - a fast and light image viewer"; - package = mkPackageOption pkgs "feh"; + package = mkPackageOption pkgs "feh" { }; buttons = mkOption { default = { };