mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
`literalExpression` is intended just to signify code that needs to stay a string that gets represented exactly as-is for docs. It has been misused heavily and people get confused repeatedly on when or not to use it because of the rampant misuse.
59 lines
1.2 KiB
Nix
59 lines
1.2 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.programs.imv;
|
|
|
|
toConfig =
|
|
attrs:
|
|
''
|
|
# Generated by Home Manager.
|
|
''
|
|
+ lib.generators.toINI { } attrs;
|
|
in
|
|
{
|
|
meta.maintainers = [ lib.maintainers.christoph-heiss ];
|
|
|
|
options.programs.imv = {
|
|
enable = lib.mkEnableOption "imv: a command line image viewer intended for use with tiling window managers";
|
|
|
|
package = lib.mkPackageOption pkgs "imv" { nullable = true; };
|
|
|
|
settings = lib.mkOption {
|
|
default = { };
|
|
type =
|
|
with lib.types;
|
|
attrsOf (
|
|
attrsOf (oneOf [
|
|
bool
|
|
int
|
|
str
|
|
])
|
|
);
|
|
description = ''
|
|
Configuration options for imv. See
|
|
{manpage}`imv(5)`.
|
|
'';
|
|
example = {
|
|
options.background = "ffffff";
|
|
aliases.x = "close";
|
|
};
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
assertions = [
|
|
(lib.hm.assertions.assertPlatform "programs.imv" pkgs lib.platforms.linux)
|
|
];
|
|
|
|
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
|
|
|
xdg.configFile = lib.mkIf (cfg.settings != { }) {
|
|
"imv/config".text = toConfig cfg.settings;
|
|
};
|
|
};
|
|
}
|