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
|
|
@ -49,6 +49,7 @@
|
|||
}:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
mylib = import ./lib;
|
||||
overlay-stable = final: prev: {
|
||||
stable = import nixpkgs-stable {
|
||||
inherit system;
|
||||
|
|
@ -75,7 +76,7 @@
|
|||
in
|
||||
nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
specialArgs = { inherit data; };
|
||||
specialArgs = { inherit data; inherit mylib; };
|
||||
modules = [
|
||||
{ nixpkgs.overlays = my-overlays; }
|
||||
./hosts/${host}/configuration.nix
|
||||
|
|
@ -94,6 +95,7 @@
|
|||
./hosts/${host}/home
|
||||
] ++ extra-home-modules;
|
||||
};
|
||||
home-manager.extraSpecialArgs = { inherit mylib; };
|
||||
}
|
||||
])
|
||||
;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ config, osConfig, pkgs, ... }:
|
||||
{ config, osConfig, pkgs, mylib, ... }:
|
||||
|
||||
{
|
||||
home.username = "lgm";
|
||||
|
|
@ -93,14 +93,20 @@
|
|||
minetest
|
||||
# dev
|
||||
# Wrap idea-community to add libraries required for Minecraft Moddev
|
||||
(symlinkJoin {
|
||||
name = "idea-community";
|
||||
paths = [ jetbrains.idea-community ];
|
||||
buildInputs = [ makeWrapper ];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/idea-community \
|
||||
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [libpulseaudio libGL glfw openal stdenv.cc.cc.lib]}"
|
||||
'';
|
||||
stable.jetbrains.idea-community
|
||||
(mylib.appwrapper {
|
||||
inherit pkgs;
|
||||
inputpkg = stable.jetbrains.idea-community;
|
||||
pkgsuffix = "mcdev-jbr17";
|
||||
libraries = with pkgs; [libpulseaudio libGL glfw openal stdenv.cc.cc.lib];
|
||||
extrapathpkgs = with pkgs; [jetbrains.jdk-no-jcef-17];
|
||||
})
|
||||
(mylib.appwrapper {
|
||||
inherit pkgs;
|
||||
inputpkg = stable.jetbrains.idea-community;
|
||||
pkgsuffix = "mcdev-jbr21";
|
||||
libraries = with pkgs; [libpulseaudio libGL glfw openal stdenv.cc.cc.lib];
|
||||
extrapathpkgs = with pkgs; [jetbrains.jdk-no-jcef];
|
||||
})
|
||||
packwiz
|
||||
# vscodium # see programs.vscode
|
||||
|
|
|
|||
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