Merge pull request #153398 from jtojnar/tracker-subcommands

nixos/tracker: Define env var so it can find miners’ subcommands
This commit is contained in:
Jan Tojnar 2022-01-09 16:09:35 +01:00 committed by GitHub
commit 67879a9353
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

View file

@ -47,6 +47,8 @@ with lib;
systemd.packages = [ pkgs.tracker-miners ];
services.gnome.tracker.subcommandPackages = [ pkgs.tracker-miners ];
};
}

View file

@ -4,6 +4,9 @@
with lib;
let
cfg = config.services.gnome.tracker;
in
{
meta = {
@ -33,6 +36,15 @@ with lib;
'';
};
subcommandPackages = mkOption {
type = types.listOf types.package;
default = [ ];
internal = true;
description = ''
List of packages containing tracker3 subcommands.
'';
};
};
};
@ -40,7 +52,7 @@ with lib;
###### implementation
config = mkIf config.services.gnome.tracker.enable {
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.tracker ];
@ -48,6 +60,17 @@ with lib;
systemd.packages = [ pkgs.tracker ];
environment.variables = {
TRACKER_CLI_SUBCOMMANDS_DIR =
let
subcommandPackagesTree = pkgs.symlinkJoin {
name = "tracker-with-subcommands-${pkgs.tracker.version}";
paths = [ pkgs.tracker ] ++ cfg.subcommandPackages;
};
in
"${subcommandPackagesTree}/libexec/tracker3";
};
};
}