grimm-nixos-laptop/common/tooling/ranger.nix

38 lines
685 B
Nix
Raw Normal View History

2024-05-31 17:33:40 +02:00
{
pkgs,
config,
inputs,
lib,
...
}:
let
inherit (config.grimmShared) enable tooling;
2024-09-28 22:09:24 +02:00
inherit (lib)
mkIf
mapAttrs'
concatLines
attrNames
;
2024-05-31 17:33:40 +02:00
plugins = {
2024-09-28 22:09:24 +02:00
ranger_udisk_menu = inputs.ranger_udisk_menu;
2024-05-31 17:33:40 +02:00
};
in
{
config = mkIf (enable && tooling.enable) {
services.gvfs = {
enable = true;
package = pkgs.gvfs;
};
environment.systemPackages = [ pkgs.ranger ];
2024-09-28 22:09:24 +02:00
environment.etc =
(mapAttrs' (n: v: {
name = "ranger/plugins/${n}";
value.source = v;
}) plugins)
// {
"ranger/commands.py".text = concatLines (map (n: "from plugins.${n} import *") (attrNames plugins));
};
2024-05-31 17:33:40 +02:00
};
}