aboutsummaryrefslogtreecommitdiffstats
path: root/modules/file-management
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-08-29 03:45:10 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-08-29 03:50:33 +0530
commit1a39cf221e3f647df0767c88d89a54e3813e7019 (patch)
treeb3df1afb0bcc0942a364f267f993ed1a9bfb9434 /modules/file-management
parente9e375f5f5263964fe89479a2610081000959774 (diff)
downloadhome-manager-config-1a39cf221e3f647df0767c88d89a54e3813e7019.tar.gz
home-manager-config-1a39cf221e3f647df0767c88d89a54e3813e7019.zip
refactor: adding explicit options to enable scripts
- some scripts that are not critical to the functioning of other options, can be enabled/disabled
Diffstat (limited to 'modules/file-management')
-rw-r--r--modules/file-management/yazi/default.nix33
-rw-r--r--modules/file-management/yazi/file-chooser.sh (renamed from modules/file-management/yazi/yazi-file-chooser.sh)0
2 files changed, 19 insertions, 14 deletions
diff --git a/modules/file-management/yazi/default.nix b/modules/file-management/yazi/default.nix
index d704614..2f7c44f 100644
--- a/modules/file-management/yazi/default.nix
+++ b/modules/file-management/yazi/default.nix
@@ -6,22 +6,14 @@
...
}:
let
- inherit ((import ../../lib/script.nix { inherit lib pkgs; })) mkScriptModule;
- yaziFileChooser = mkScriptModule {
- scope = [
- "file-management"
- "yazi"
- ];
+ yaziFileChooserScript = pkgs.writeShellApplication {
name = "yazi-file-chooser";
- path = ./yazi-file-chooser.sh;
- description = "Yazi-based file chooser for XDG Desktop Portal";
- deps = [
+ runtimeInputs = [
pkgs.bash
config.file-management.yazi.package
config.terminal.kitty.package
];
- extraLinks = [ "~/.config/xdg-desktop-portal-termfilechooser/config" ];
- inherit config;
+ text = builtins.readFile ./file-chooser.sh;
};
in
{
@@ -39,8 +31,17 @@ in
defaultText = lib.literalExpression "config.programs.yazi.finalPackage";
description = "The yazi package to use. Defaults to the wrapped finalPackage from programs.yazi.";
};
- }
- // yaziFileChooser.options.file-management.yazi;
+
+ file-chooser = {
+ enable = lib.mkEnableOption "Enables the yazi-file-chooser script.";
+ package = lib.mkOption {
+ type = lib.types.package;
+ readOnly = true;
+ default = yaziFileChooserScript;
+ description = "The yazi-file-chooser script package.";
+ };
+ };
+ };
config = lib.mkMerge [
(lib.mkIf config.file-management.yazi.enable {
@@ -77,6 +78,10 @@ in
TERMCMD = lib.mkIf config.terminal.kitty.enable "${lib.getExe config.terminal.kitty.package} --class file-explorer --title 'Yazi'";
};
})
- yaziFileChooser.config
+ (lib.mkIf config.file-management.yazi.file-chooser.enable {
+ home.file.".config/xdg-desktop-portal-termfilechooser/config" = {
+ source = lib.getExe config.file-management.yazi.file-chooser.package;
+ };
+ })
];
}
diff --git a/modules/file-management/yazi/yazi-file-chooser.sh b/modules/file-management/yazi/file-chooser.sh
index 7978222..7978222 100644
--- a/modules/file-management/yazi/yazi-file-chooser.sh
+++ b/modules/file-management/yazi/file-chooser.sh