mirror of
https://git.lgmrszd.xyz/Lgmrszd/nix-cfg.git
synced 2025-12-13 23:28:20 +01:00
laptop: add IDEA wrappers
This commit is contained in:
parent
e24934ae66
commit
012afecf57
3 changed files with 47 additions and 10 deletions
29
lib/default.nix
Normal file
29
lib/default.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
appwrapper =
|
||||
{
|
||||
pkgs,
|
||||
inputpkg,
|
||||
pkgsuffix,
|
||||
libraries,
|
||||
extrapathpkgs
|
||||
}: with pkgs; let
|
||||
name = "${inputpkg.pname}-${pkgsuffix}";
|
||||
in stdenv.mkDerivation {
|
||||
inherit name;
|
||||
inherit (inputpkg) version;
|
||||
nativeBuildInputs = [ makeWrapper gnused ];
|
||||
buildCommand = ''
|
||||
mkdir -p $out/bin
|
||||
mkdir -p $out/share/applications
|
||||
cp ${inputpkg}/share/applications/${inputpkg.pname}.desktop $out/share/applications/${name}.desktop
|
||||
makeWrapper ${inputpkg}/bin/${inputpkg.pname} $out/bin/${name} \
|
||||
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath libraries}" \
|
||||
--prefix PATH : "${lib.makeBinPath extrapathpkgs}"
|
||||
substituteInPlace $out/share/applications/${name}.desktop \
|
||||
--replace-fail "=${inputpkg.pname}" "=${name}"
|
||||
sed -i -E "s/^Name=(.*)/Name=\1 (${pkgsuffix})/g" "$out/share/applications/${name}.desktop"
|
||||
echo $out/bin/${name}
|
||||
'';
|
||||
dontBuild = true;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue