mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 12:19:07 +00:00
init: pop-launcher at 1.1.0
This commit is contained in:
parent
4a29a03143
commit
9c15267ba6
@ -4,5 +4,6 @@
|
||||
doggo = pkgs.callPackage ./doggo.nix { };
|
||||
gnome-shell-extension-pop-shell = pkgs.callPackage ./gnome-shell-extension-pop-shell.nix { };
|
||||
libcs50 = pkgs.callPackage ./libcs50.nix { };
|
||||
pop-launcher = pkgs.callPackage ./pop-launcher.nix { };
|
||||
tic-80 = pkgs.callPackage ./tic-80.nix { };
|
||||
}
|
||||
|
52
pkgs/pop-launcher.nix
Normal file
52
pkgs/pop-launcher.nix
Normal file
@ -0,0 +1,52 @@
|
||||
{ lib, fetchFromGitHub, rustPlatform, pkg-config, openssl, gtk3 }:
|
||||
|
||||
let
|
||||
distributionPluginPath = "$out/lib/pop-launcher";
|
||||
in
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "pop-launcher";
|
||||
version = "1.1.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "pop-os";
|
||||
repo = "launcher";
|
||||
rev = version;
|
||||
sha256 = "sha256-I713Er96ONt7L0LLzemNtc/qpy+RBaAuNF7SU+FG8LA=";
|
||||
};
|
||||
|
||||
cargoBuildFlags = [ "-p" "pop-launcher-bin" ];
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ openssl gtk3 ];
|
||||
|
||||
# Replace the distribution plugins path since it is only usable with traditional Linux distros.
|
||||
prePatchPhase = ''
|
||||
substituteInPlace src/lib.rs --replace "/usr/lib/pop-launcher" "${distributionPluginPath}"
|
||||
substituteInPlace plugins/src/scripts/mod.rs --replace "/usr/lib/pop-launcher/scripts" "${distributionPluginPath}/scripts"
|
||||
'';
|
||||
|
||||
# Installing and configuring the built-in plugins.
|
||||
postInstall = ''
|
||||
# Clean up the name.
|
||||
mv $out/bin/pop-launcher{-bin,}
|
||||
|
||||
# Configure the built-in plugins properly.
|
||||
for plugin in plugins/src/*; do
|
||||
plugin_name=$(basename "$plugin")
|
||||
plugin_path="${distributionPluginPath}/plugins/$plugin_name"
|
||||
|
||||
# We are only after the plugins which are stored inside subdirectories.
|
||||
[ -d $plugin ] || continue
|
||||
|
||||
# Configure each built-in plugin with the plugin metadata file and the binary (which is also `pop-launcher`).
|
||||
mkdir -p "$plugin_path" && cp "$plugin/plugin.ron" "$plugin_path"
|
||||
ln -sf "$out/bin/pop-launcher" "$plugin_path/$plugin_name"
|
||||
done
|
||||
'';
|
||||
|
||||
cargoSha256 = "sha256-swkQAja+t/yz5TFq5omskP7e/OVaHK7/a6TFuP+T/VY=";
|
||||
meta = with lib; {
|
||||
description = "Modular IPC-based desktop launcher service";
|
||||
homepage = "https://github.com/pop-os/launcher";
|
||||
license = licenses.gpl3;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user