From b254f540ff266a06fdee16674982da826f3dfbb4 Mon Sep 17 00:00:00 2001 From: Sam Hug Date: Sat, 4 Jun 2022 14:53:30 -0700 Subject: [PATCH] pop-launcher: init at 1.2.1 --- .../misc/pop-launcher/default.nix | 60 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 62 insertions(+) create mode 100644 pkgs/applications/misc/pop-launcher/default.nix diff --git a/pkgs/applications/misc/pop-launcher/default.nix b/pkgs/applications/misc/pop-launcher/default.nix new file mode 100644 index 000000000000000..ca4a1742e1e1af2 --- /dev/null +++ b/pkgs/applications/misc/pop-launcher/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index dc860b31194c6b5..e68bc86a827f515 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { };