programs/pop-launcher: make plugin packages not rewrite symlinks

This commit is contained in:
Gabriel Arazas 2022-08-10 12:43:33 +08:00
parent 10fd8f8ca1
commit 8651fc7a4d

View File

@ -12,11 +12,17 @@ let
dontRewriteSymlinks = true; dontRewriteSymlinks = true;
}); });
# Some plugins may be packaged busybox-style with multiple plugins in one
# binary.
plugins = lib.lists.map (p: p.overrideAttrs (prev: {
dontRewriteSymlinks = true;
})) cfg.plugins;
# Plugins and scripts are assumed to be packaged at # Plugins and scripts are assumed to be packaged at
# `$out/share/pop-launcher`. # `$out/share/pop-launcher`.
pluginsDir = pkgs.symlinkJoin { pluginsDir = pkgs.symlinkJoin {
name = "pop-launcher-plugins-system"; name = "pop-launcher-plugins-system";
paths = builtins.map (p: "${p}/share/pop-launcher") (cfg.plugins ++ [ package ]); paths = builtins.map (p: "${p}/share/pop-launcher") (plugins ++ [ package ]);
}; };
in in
{ {
@ -64,9 +70,7 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
environment.etc.pop-launcher = lib.mkIf (cfg.plugins != []) { environment.etc.pop-launcher.source = pluginsDir;
source = pluginsDir;
};
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
pop-launcher pop-launcher