grimm-nixos-laptop/common/tooling/ranger.nix
2024-05-31 17:33:40 +02:00

31 lines
643 B
Nix

{
pkgs,
config,
inputs,
lib,
...
}:
let
inherit (config.grimmShared) enable tooling;
inherit (lib) mkIf mapAttrs' concatLines attrNames;
plugins = {
ranger_udisk_menu = inputs.ranger_udisk_menu;
};
in
{
config = mkIf (enable && tooling.enable) {
services.gvfs = {
enable = true;
package = pkgs.gvfs;
};
environment.systemPackages = [ pkgs.ranger ];
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));
};
};
}