From 98be8e8da406c201f72ef9460030e8ca2c6fceed Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sat, 30 Dec 2023 13:45:59 +0100 Subject: [PATCH] Convert Zathura configuration to module --- home-manager/zathura.nix | 13 ----------- hosts/luci/home-config.nix | 3 +++ .../application/zathura/default.nix | 23 +++++++++++++++++++ modules/home-manager/default.nix | 1 + nixos/default.nix | 1 - 5 files changed, 27 insertions(+), 14 deletions(-) delete mode 100644 home-manager/zathura.nix create mode 100644 modules/home-manager/application/zathura/default.nix diff --git a/home-manager/zathura.nix b/home-manager/zathura.nix deleted file mode 100644 index cd1d000..0000000 --- a/home-manager/zathura.nix +++ /dev/null @@ -1,13 +0,0 @@ -_: { - programs.zathura = { - enable = true; - options = { - selection-clipboard = "clipboard"; - font = "Fira Sans 12"; - recolor = true; - }; - }; - xdg.mimeApps.defaultApplications = { - "application/pdf" = "org.pwmt.zathura.desktop"; - }; -} diff --git a/hosts/luci/home-config.nix b/hosts/luci/home-config.nix index 246d67d..9a488b1 100644 --- a/hosts/luci/home-config.nix +++ b/hosts/luci/home-config.nix @@ -1,5 +1,8 @@ { ... }: { config.modules = { + application = { + zathura.enable = true; + }; cli.neovim.enable = true; cli.vifm.enable = true; video.kdenlive.enable = false; diff --git a/modules/home-manager/application/zathura/default.nix b/modules/home-manager/application/zathura/default.nix new file mode 100644 index 0000000..d710830 --- /dev/null +++ b/modules/home-manager/application/zathura/default.nix @@ -0,0 +1,23 @@ +{ lib, config, ... }: +with lib; +let + cfg = config.modules.application.zathura; +in +{ + options.modules.application.zathura = { + enable = mkEnableOption "enable Zathura PDF viewer"; + }; + config = mkIf cfg.enable { + programs.zathura = { + enable = true; + options = { + selection-clipboard = "clipboard"; + font = "Fira Sans 12"; + recolor = true; + }; + }; + xdg.mimeApps.defaultApplications = { + "application/pdf" = "org.pwmt.zathura.desktop"; + }; + }; +} diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 0e02297..b82e41e 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -1,6 +1,7 @@ { ... }: { imports = [ + ./application/zathura ./cli/neovim ./cli/vifm ./cli/zsh diff --git a/nixos/default.nix b/nixos/default.nix index 261945c..a874dbd 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -67,7 +67,6 @@ ] ++ (if hostConfig.desktop then [ ../home-manager/foot.nix - ../home-manager/zathura.nix ../home-manager/imv.nix ../home-manager/mpv ]