2023-06-07 14:51:05 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.imv;
|
|
|
|
|
|
|
|
toConfig = attrs:
|
|
|
|
''
|
|
|
|
# Generated by Home Manager.
|
|
|
|
'' + generators.toINI { } attrs;
|
|
|
|
in {
|
|
|
|
meta.maintainers = [ maintainers.christoph-heiss ];
|
|
|
|
|
|
|
|
options.programs.imv = {
|
2023-07-02 01:45:18 +02:00
|
|
|
enable = mkEnableOption
|
|
|
|
"imv: a command line image viewer intended for use with tiling window managers";
|
2023-06-07 14:51:05 +02:00
|
|
|
|
2023-07-02 01:45:18 +02:00
|
|
|
package = mkPackageOption pkgs "imv" { };
|
2023-06-07 14:51:05 +02:00
|
|
|
|
|
|
|
settings = mkOption {
|
|
|
|
default = { };
|
|
|
|
type = with types; attrsOf (attrsOf (oneOf [ bool int str ]));
|
2023-07-02 01:45:18 +02:00
|
|
|
description = ''
|
2023-06-07 14:51:05 +02:00
|
|
|
Configuration options for imv. See
|
2023-07-01 01:30:13 +02:00
|
|
|
{manpage}`imv(5)`.
|
2023-06-07 14:51:05 +02:00
|
|
|
'';
|
|
|
|
example = literalExpression ''
|
|
|
|
{
|
|
|
|
options.background = "ffffff";
|
|
|
|
aliases.x = "close";
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
assertions =
|
|
|
|
[ (hm.assertions.assertPlatform "programs.imv" pkgs platforms.linux) ];
|
|
|
|
|
|
|
|
home.packages = [ cfg.package ];
|
|
|
|
|
|
|
|
xdg.configFile =
|
|
|
|
mkIf (cfg.settings != { }) { "imv/config".text = toConfig cfg.settings; };
|
|
|
|
};
|
|
|
|
}
|