mirror of
https://github.com/nix-community/home-manager
synced 2024-11-14 00:47:12 +00:00
39c7d0a97a
* imv: add module Signed-off-by: Christoph Heiss <christoph@c8h4.io> * imv: add test cases Signed-off-by: Christoph Heiss <christoph@c8h4.io> --------- Signed-off-by: Christoph Heiss <christoph@c8h4.io> Co-authored-by: Naïm Favier <n@monade.li>
49 lines
1.1 KiB
Nix
49 lines
1.1 KiB
Nix
{ 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 = {
|
|
enable = mkEnableOption
|
|
"imv: a command line image viewer intended for use with tiling window managers";
|
|
|
|
package = mkPackageOption pkgs "imv" { };
|
|
|
|
settings = mkOption {
|
|
default = { };
|
|
type = with types; attrsOf (attrsOf (oneOf [ bool int str ]));
|
|
description = ''
|
|
Configuration options for imv. See
|
|
<citerefentry>
|
|
<refentrytitle>imv</refentrytitle>
|
|
<manvolnum>5</manvolnum>
|
|
</citerefentry>.
|
|
'';
|
|
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; };
|
|
};
|
|
}
|