Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pop-launcher: init at 1.2.1 #176303

Merged
merged 2 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12003,6 +12003,12 @@
githubId = 6022042;
name = "Sam Parkinson";
};
samhug = {
email = "[email protected]";
github = "samhug";
githubId = 171470;
name = "Sam Hug";
};
samlich = {
email = "[email protected]";
github = "samlich";
Expand Down
60 changes: 60 additions & 0 deletions pkgs/applications/misc/pop-launcher/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{ rustPlatform
, fetchFromGitHub
, lib
, fd
, libqalculate
}:

rustPlatform.buildRustPackage rec {
pname = "pop-launcher";
version = "1.2.1";

src = fetchFromGitHub {
owner = "pop-os";
repo = "launcher";
rev = version;
sha256 = "sha256-BQAO9IodZxGgV8iBmUaOF0yDbAMVDFslKCqlh3pBnb0=";
};

postPatch = ''
substituteInPlace src/lib.rs \
--replace '/usr/lib/pop-launcher' "$out/share/pop-launcher"
substituteInPlace plugins/src/scripts/mod.rs \
--replace '/usr/lib/pop-launcher' "$out/share/pop-launcher"
substituteInPlace plugins/src/calc/mod.rs \
--replace 'Command::new("qalc")' 'Command::new("${libqalculate}/bin/qalc")'
substituteInPlace plugins/src/find/mod.rs \
--replace 'spawn("fd")' 'spawn("${fd}/bin/fd")'
substituteInPlace plugins/src/terminal/mod.rs \
--replace '/usr/bin/gnome-terminal' 'gnome-terminal'
'';

cargoSha256 = "sha256-cTvrq0fH057UIx/O9u8zHMsg+psMGg1q9klV5OMxtok=";

cargoBuildFlags = [ "--package" "pop-launcher-bin" ];

postInstall = ''
mv $out/bin/pop-launcher{-bin,}

plugins_dir=$out/share/pop-launcher/plugins
scripts_dir=$out/share/pop-launcher/scripts
mkdir -p $plugins_dir $scripts_dir

for plugin in $(find plugins/src -mindepth 1 -maxdepth 1 -type d -printf '%f\n'); do
mkdir $plugins_dir/$plugin
cp plugins/src/$plugin/*.ron $plugins_dir/$plugin
ln -sf $out/bin/pop-launcher $plugins_dir/$plugin/$(echo $plugin | sed 's/_/-/')
done

for script in scripts/*; do
cp -r $script $scripts_dir
done
'';

meta = with lib; {
description = "Modular IPC-based desktop launcher service";
homepage = "https://github.com/pop-os/launcher";
license = licenses.mpl20;
maintainers = with maintainers; [ samhug ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31184,6 +31184,8 @@ with pkgs;

ponymix = callPackage ../applications/audio/ponymix { };

pop-launcher = callPackage ../applications/misc/pop-launcher { };

popcorntime = callPackage ../applications/video/popcorntime {};

pothos = libsForQt5.callPackage ../applications/radio/pothos { };
Expand Down