mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 21:25:30 +03:00
wayfire: add plugin support
The top-level "wayfire" attribute is a Wayfire with wf-shell installed and nothing else. But wayfireApplications.withPlugins can be used to create a Wayfire with arbitrary plugins, or no plugins at all.
This commit is contained in:
parent
e2243140f9
commit
c898defdbf
4 changed files with 80 additions and 3 deletions
23
pkgs/applications/window-managers/wayfire/applications.nix
Normal file
23
pkgs/applications/window-managers/wayfire/applications.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{ newScope, wayfirePlugins }:
|
||||||
|
|
||||||
|
let
|
||||||
|
self = with self; {
|
||||||
|
inherit wayfirePlugins;
|
||||||
|
|
||||||
|
callPackage = newScope self;
|
||||||
|
|
||||||
|
wayfire = callPackage ./. { };
|
||||||
|
|
||||||
|
wcm = callPackage ./wcm.nix {
|
||||||
|
inherit (wayfirePlugins) wf-shell;
|
||||||
|
};
|
||||||
|
|
||||||
|
wrapWayfireApplication = callPackage ./wrapper.nix { };
|
||||||
|
|
||||||
|
withPlugins = selector: self // {
|
||||||
|
wayfire = wrapWayfireApplication wayfire selector;
|
||||||
|
wcm = wrapWayfireApplication wcm selector;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
self
|
12
pkgs/applications/window-managers/wayfire/plugins.nix
Normal file
12
pkgs/applications/window-managers/wayfire/plugins.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{ newScope, wayfire }:
|
||||||
|
|
||||||
|
let
|
||||||
|
self = with self; {
|
||||||
|
inherit wayfire;
|
||||||
|
|
||||||
|
callPackage = newScope self;
|
||||||
|
|
||||||
|
wf-shell = callPackage ./wf-shell.nix { };
|
||||||
|
};
|
||||||
|
in
|
||||||
|
self
|
39
pkgs/applications/window-managers/wayfire/wrapper.nix
Normal file
39
pkgs/applications/window-managers/wayfire/wrapper.nix
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
{ runCommandNoCC, lib, makeWrapper, wayfirePlugins }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) escapeShellArg makeBinPath;
|
||||||
|
|
||||||
|
xmlPath = plugin: "${plugin}/share/wayfire/metadata/wf-shell";
|
||||||
|
|
||||||
|
makePluginPath = lib.makeLibraryPath;
|
||||||
|
makePluginXMLPath = lib.concatMapStringsSep ":" xmlPath;
|
||||||
|
in
|
||||||
|
|
||||||
|
application:
|
||||||
|
|
||||||
|
choosePlugins:
|
||||||
|
|
||||||
|
let
|
||||||
|
plugins = choosePlugins wayfirePlugins;
|
||||||
|
in
|
||||||
|
|
||||||
|
runCommandNoCC "${application.name}-wrapped" {
|
||||||
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
|
|
||||||
|
passthru = application.passthru // {
|
||||||
|
unwrapped = application;
|
||||||
|
};
|
||||||
|
|
||||||
|
inherit (application) meta;
|
||||||
|
} ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
for bin in ${application}/bin/*
|
||||||
|
do
|
||||||
|
makeWrapper "$bin" $out/bin/''${bin##*/} \
|
||||||
|
--suffix PATH : ${escapeShellArg (makeBinPath plugins)} \
|
||||||
|
--suffix WAYFIRE_PLUGIN_PATH : ${escapeShellArg (makePluginPath plugins)} \
|
||||||
|
--suffix WAYFIRE_PLUGIN_XML_PATH : ${escapeShellArg (makePluginXMLPath plugins)}
|
||||||
|
done
|
||||||
|
find ${application} -mindepth 1 -maxdepth 1 -not -name bin \
|
||||||
|
-exec ln -s '{}' $out ';'
|
||||||
|
''
|
|
@ -24755,10 +24755,13 @@ in
|
||||||
way-cooler = throw ("way-cooler is abandoned by its author: " +
|
way-cooler = throw ("way-cooler is abandoned by its author: " +
|
||||||
"https://way-cooler.org/blog/2020/01/09/way-cooler-post-mortem.html");
|
"https://way-cooler.org/blog/2020/01/09/way-cooler-post-mortem.html");
|
||||||
|
|
||||||
wayfire = callPackage ../applications/window-managers/wayfire { };
|
wayfireApplications = wayfireApplications-unwrapped.withPlugins (plugins: [ plugins.wf-shell ]);
|
||||||
wcm = callPackage ../applications/window-managers/wayfire/wcm.nix { };
|
inherit (wayfireApplications) wayfire wcm;
|
||||||
|
wayfireApplications-unwrapped = callPackage ../applications/window-managers/wayfire/applications.nix { };
|
||||||
|
wayfirePlugins = callPackage ../applications/window-managers/wayfire/plugins.nix {
|
||||||
|
inherit (wayfireApplications-unwrapped) wayfire;
|
||||||
|
};
|
||||||
wf-config = callPackage ../applications/window-managers/wayfire/wf-config.nix { };
|
wf-config = callPackage ../applications/window-managers/wayfire/wf-config.nix { };
|
||||||
wf-shell = callPackage ../applications/window-managers/wayfire/wf-shell.nix { };
|
|
||||||
|
|
||||||
waypipe = callPackage ../applications/networking/remote/waypipe { };
|
waypipe = callPackage ../applications/networking/remote/waypipe { };
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue