mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
feh: add module
This commit is contained in:
parent
721f924e15
commit
f5289c546e
2 changed files with 42 additions and 0 deletions
|
@ -17,6 +17,7 @@ let
|
||||||
./programs/browserpass.nix
|
./programs/browserpass.nix
|
||||||
./programs/eclipse.nix
|
./programs/eclipse.nix
|
||||||
./programs/emacs.nix
|
./programs/emacs.nix
|
||||||
|
./programs/feh.nix
|
||||||
./programs/firefox.nix
|
./programs/firefox.nix
|
||||||
./programs/git.nix
|
./programs/git.nix
|
||||||
./programs/gnome-terminal.nix
|
./programs/gnome-terminal.nix
|
||||||
|
|
41
modules/programs/feh.nix
Normal file
41
modules/programs/feh.nix
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.programs.feh;
|
||||||
|
|
||||||
|
disableBinding = func: key: func;
|
||||||
|
enableBinding = func: key: "${func} ${key}";
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
options.programs.feh = {
|
||||||
|
enable = mkEnableOption "feh - a fast and light image viewer";
|
||||||
|
|
||||||
|
keybindings = mkOption {
|
||||||
|
default = {};
|
||||||
|
type = types.attrs;
|
||||||
|
example = { zoom_in = "plus"; zoom_out = "minus"; };
|
||||||
|
description = ''
|
||||||
|
Set keybindings.
|
||||||
|
See <link xlink:href="https://man.finalrewind.org/1/feh/#x4b455953"/> for
|
||||||
|
default bindings and available commands.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home.packages = [ pkgs.feh ];
|
||||||
|
|
||||||
|
home.file.".config/feh/keys".text = ''
|
||||||
|
# Disable default keybindings
|
||||||
|
${concatStringsSep "\n" (mapAttrsToList disableBinding cfg.keybindings)}
|
||||||
|
|
||||||
|
# Enable new keybindings
|
||||||
|
${concatStringsSep "\n" (mapAttrsToList enableBinding cfg.keybindings)}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue