mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 18:19:09 +00:00
programs/pop-launcher: update NixOS module
Now it assumes the package is patched to search its plugins and scripts on its store path.
This commit is contained in:
parent
d8263334c0
commit
08202d1bab
@ -3,28 +3,11 @@
|
|||||||
let
|
let
|
||||||
cfg = config.programs.pop-launcher;
|
cfg = config.programs.pop-launcher;
|
||||||
|
|
||||||
# This assumes the package contains the built-in plugins being symlinked to
|
|
||||||
# the main binary with absolute paths. Most sensibly, the nixpkgs builder
|
|
||||||
# will rewrite symlinks relative to its output directory. Since we're putting
|
|
||||||
# them outside of its output directory, we'll have to stop it from doing
|
|
||||||
# that.
|
|
||||||
package = cfg.package.overrideAttrs (prev: {
|
|
||||||
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") (plugins ++ [ package ]);
|
paths = builtins.map (p: "${p}/share/pop-launcher") cfg.plugins;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@ -48,6 +31,14 @@ in
|
|||||||
description = ''
|
description = ''
|
||||||
The package where {command}`pop-launcher` binary and built-in plugins
|
The package where {command}`pop-launcher` binary and built-in plugins
|
||||||
are expected.
|
are expected.
|
||||||
|
|
||||||
|
::: {.note}
|
||||||
|
The package is assumed to have been patched to search for the
|
||||||
|
derivation output path (at {file}`$out/share/pop-launcher`) instead of
|
||||||
|
the distribution plugins path (at {file}`/usr/lib/pop-launcher`).
|
||||||
|
Otherwise, the built-in plugins will not show up in the launcher
|
||||||
|
frontend.
|
||||||
|
:::
|
||||||
'';
|
'';
|
||||||
default = pkgs.pop-launcher;
|
default = pkgs.pop-launcher;
|
||||||
};
|
};
|
||||||
@ -56,7 +47,9 @@ in
|
|||||||
type = lib.types.listOf lib.types.package;
|
type = lib.types.listOf lib.types.package;
|
||||||
description = ''
|
description = ''
|
||||||
List of packages containing Pop launcher plugins and scripts to be
|
List of packages containing Pop launcher plugins and scripts to be
|
||||||
installed as system-wide plugins.
|
installed as system-wide plugins. The launcher plugins and scripts of
|
||||||
|
each listed package are assumed to be installed at
|
||||||
|
{file}`$out/share/pop-launcher`.
|
||||||
'';
|
'';
|
||||||
default = [ ];
|
default = [ ];
|
||||||
defaultText = "[]";
|
defaultText = "[]";
|
||||||
@ -72,6 +65,6 @@ in
|
|||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
environment.etc.pop-launcher.source = pluginsDir;
|
environment.etc.pop-launcher.source = pluginsDir;
|
||||||
|
|
||||||
environment.systemPackages = [ package ];
|
environment.systemPackages = [ cfg.package ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user