fix(home-manager): avoid imv problem on non-NixOS install

There is not access to hardware acceleration when install nix above traditonnal distribution
This commit is contained in:
Yorick Barbanneau 2024-06-23 14:23:39 +02:00
parent db84a305dc
commit cf8a838191
2 changed files with 18 additions and 2 deletions

View file

@ -4,6 +4,10 @@
gnupg.enable = true;
zathura.enable = true;
foot.enable = true;
imv = {
enable = true;
installPackage = false;
};
};
cli = {
direnv.enable = true;

View file

@ -1,15 +1,27 @@
{ lib, config, ... }:
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.application.zathura;
cfg = config.modules.application.imv;
in
{
options.modules.application.imv = {
enable = mkEnableOption "enable IMV image viewer";
installPackage = mkOption {
type = types.bool;
default = true;
description = "install Package, if false relies on distribution packages";
};
};
config = mkIf cfg.enable {
programs.imv = {
enable = true;
package =
if cfg.installPackage
then pkgs.imv
else pkgs.emptyDirectory;
};
xdg.mimeApps.defaultApplications = {
"image/*" = "imv-dir.desktop";