davinci free working
This commit is contained in:
@@ -28,15 +28,12 @@
|
|||||||
hardware.graphics = {
|
hardware.graphics = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enable32Bit = true;
|
enable32Bit = true;
|
||||||
extraPackages = with pkgs; [
|
|
||||||
# This is the most critical package for AMD OpenCL
|
|
||||||
rocmPackages.clr.icd
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
hardware.amdgpu.opencl.enable = true;
|
||||||
|
|
||||||
boot.kernelParams = [
|
boot.kernelParams = [
|
||||||
"amdgpu.noretry=0"
|
"amdgpu.ppfeaturemask=0xffffffff"
|
||||||
"amdgpu.gpu_recovery=1"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# Wake on Lan
|
# Wake on Lan
|
||||||
|
|||||||
17
flake.lock
generated
17
flake.lock
generated
@@ -131,6 +131,22 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"mesa-davinci": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1754501210,
|
||||||
|
"narHash": "sha256-ahTHrGs72TLVcNUR2VHckEx+t6frke0e/Ptk6AaEINk=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "599ddd2b79331c1e6153e1659bdaab65d62c4c82",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "599ddd2b79331c1e6153e1659bdaab65d62c4c82",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1770197578,
|
"lastModified": 1770197578,
|
||||||
@@ -250,6 +266,7 @@
|
|||||||
"doot": "doot",
|
"doot": "doot",
|
||||||
"elephant": "elephant",
|
"elephant": "elephant",
|
||||||
"hyprfloat": "hyprfloat",
|
"hyprfloat": "hyprfloat",
|
||||||
|
"mesa-davinci": "mesa-davinci",
|
||||||
"nixpkgs": "nixpkgs_4",
|
"nixpkgs": "nixpkgs_4",
|
||||||
"walker": "walker",
|
"walker": "walker",
|
||||||
"way-edges": "way-edges"
|
"way-edges": "way-edges"
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
url = "github:abenz1267/walker";
|
url = "github:abenz1267/walker";
|
||||||
inputs.elephant.follows = "elephant";
|
inputs.elephant.follows = "elephant";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mesa-davinci.url = "github:nixos/nixpkgs?ref=599ddd2b79331c1e6153e1659bdaab65d62c4c82";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
@@ -49,7 +51,7 @@
|
|||||||
modules = [
|
modules = [
|
||||||
./configs/configuration-pc.nix
|
./configs/configuration-pc.nix
|
||||||
./configs/common.nix
|
./configs/common.nix
|
||||||
./modules/davinci/davinci.nix
|
./modules/davinci/default.nix
|
||||||
./modules/i3/i3.nix
|
./modules/i3/i3.nix
|
||||||
hardwareConfig
|
hardwareConfig
|
||||||
{
|
{
|
||||||
|
|||||||
203
modules/davinci/default.nix
Normal file
203
modules/davinci/default.nix
Normal file
@@ -0,0 +1,203 @@
|
|||||||
|
# resolve/default.nix
|
||||||
|
{
|
||||||
|
pkgs-unstable,
|
||||||
|
inputs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
studio-variant = true;
|
||||||
|
mesa-good-pkg = inputs.mesa-davinci.legacyPackages.x86_64-linux.mesa;
|
||||||
|
pkgs-unstable =
|
||||||
|
import
|
||||||
|
(builtins.fetchTarball {
|
||||||
|
url = "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz";
|
||||||
|
})
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
allowUnfree = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
original =
|
||||||
|
if studio-variant then pkgs-unstable.davinci-resolve-studio else pkgs-unstable.davinci-resolve;
|
||||||
|
davinci-unwrapped = original.passthru.davinci;
|
||||||
|
|
||||||
|
ffmpeg-encoder-plugin = pkgs-unstable.stdenv.mkDerivation (finalAttrs: {
|
||||||
|
pname = "ffmpeg-encoder-plugin";
|
||||||
|
version = "1.2.1";
|
||||||
|
|
||||||
|
src = pkgs-unstable.fetchFromGitHub {
|
||||||
|
owner = "EdvinNilsson";
|
||||||
|
repo = "ffmpeg_encoder_plugin";
|
||||||
|
rev = "v${finalAttrs.version}";
|
||||||
|
hash = "sha256-F4Q8YCXD5UldTwLbWK4nHacNPQ/B+4yLL96sq7xZurM=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ pkgs-unstable.cmake ];
|
||||||
|
buildInputs = [ pkgs-unstable.ffmpeg-full ];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
cp ffmpeg_encoder_plugin.dvcp $out/
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
|
||||||
|
aac-encoder-plugin = pkgs-unstable.stdenv.mkDerivation {
|
||||||
|
pname = "aac-encoder-plugin";
|
||||||
|
version = "1.0.1";
|
||||||
|
src = pkgs-unstable.fetchFromGitHub {
|
||||||
|
owner = "Toxblh";
|
||||||
|
repo = "davinci-linux-aac-codec";
|
||||||
|
rev = "v1.0.1";
|
||||||
|
hash = "sha256-NVNxmUFNwZ3hzlyi3QVENXhfPICAAP3M4s6QEgWsP/g=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
pkgs-unstable.clang
|
||||||
|
pkgs-unstable.gnumake
|
||||||
|
];
|
||||||
|
buildInputs = [
|
||||||
|
pkgs-unstable.ffmpeg-full.dev
|
||||||
|
pkgs-unstable.ffmpeg-full.lib
|
||||||
|
];
|
||||||
|
|
||||||
|
dontConfigure = true;
|
||||||
|
buildPhase = ''
|
||||||
|
make clean
|
||||||
|
make CC=${pkgs-unstable.clang}/bin/clang++
|
||||||
|
'';
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
if [ -f bin/aac_encoder_plugin.dvcp ]; then
|
||||||
|
cp bin/aac_encoder_plugin.dvcp $out/
|
||||||
|
else
|
||||||
|
cp aac_encoder_plugin.dvcp $out/
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
davinci-with-plugin =
|
||||||
|
pkgs-unstable.runCommand
|
||||||
|
"${davinci-unwrapped.pname}-with-ffmpeg-plugin-${davinci-unwrapped.version}"
|
||||||
|
{ }
|
||||||
|
''
|
||||||
|
cp -a ${davinci-unwrapped} $out
|
||||||
|
chmod -R u+w $out
|
||||||
|
mkdir -p $out/IOPlugins/ffmpeg_encoder_plugin.dvcp.bundle/Contents/Linux-x86-64
|
||||||
|
cp ${ffmpeg-encoder-plugin}/ffmpeg_encoder_plugin.dvcp \
|
||||||
|
$out/IOPlugins/ffmpeg_encoder_plugin.dvcp.bundle/Contents/Linux-x86-64/
|
||||||
|
mkdir -p $out/IOPlugins/aac_encoder_plugin.dvcp.bundle/Contents/Linux-x86-64
|
||||||
|
cp ${aac-encoder-plugin}/aac_encoder_plugin.dvcp \
|
||||||
|
$out/IOPlugins/aac_encoder_plugin.dvcp.bundle/Contents/Linux-x86-64/
|
||||||
|
'';
|
||||||
|
|
||||||
|
davinci = davinci-with-plugin;
|
||||||
|
|
||||||
|
davinci-fixed = pkgs-unstable.buildFHSEnv {
|
||||||
|
pname = davinci-unwrapped.pname;
|
||||||
|
version = davinci-unwrapped.version;
|
||||||
|
|
||||||
|
# original.extraPreBwrapCmds is exposed, but it does not respect our studio-variant flag, so we inline it here:
|
||||||
|
extraPreBwrapCmds = lib.optionalString studio-variant ''
|
||||||
|
mkdir -p ~/.local/share/DaVinciResolve/license || exit 1
|
||||||
|
mkdir -p ~/.local/share/DaVinciResolve/Extras || exit 1
|
||||||
|
'';
|
||||||
|
|
||||||
|
# original.extraBwrapArgs is exposed, but it does not respect our studio-variant flag, so we inline it here:
|
||||||
|
extraBwrapArgs = lib.optionals studio-variant [
|
||||||
|
''--bind "$HOME"/.local/share/DaVinciResolve/license ${davinci}/.license''
|
||||||
|
''--bind "$HOME"/.local/share/DaVinciResolve/Extras ${davinci}/Extras''
|
||||||
|
];
|
||||||
|
|
||||||
|
extraBuildCommands = ''
|
||||||
|
mkdir -p opt
|
||||||
|
ln -s ${davinci} opt/resolve
|
||||||
|
'';
|
||||||
|
|
||||||
|
runScript = "${pkgs-unstable.bash}/bin/bash ${pkgs-unstable.writeText "davinci-wrapper-goodmesa" ''
|
||||||
|
export QT_XKB_CONFIG_ROOT="${pkgs-unstable.xkeyboard_config}/share/X11/xkb"
|
||||||
|
export QT_PLUGIN_PATH="${davinci}/libs/plugins:$QT_PLUGIN_PATH"
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH=${pkgs-unstable.ffmpeg-full.lib}/lib:${pkgs-unstable.shaderc.lib}/lib:${pkgs-unstable.vulkan-loader}/lib:${pkgs-unstable.stdenv.cc.cc.lib}/lib:${mesa-good-pkg}/lib:${mesa-good-pkg}/lib/dri:$LD_LIBRARY_PATH
|
||||||
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/usr/lib32:${davinci}/libs
|
||||||
|
export LD_PRELOAD=${pkgs-unstable.shaderc.lib}/lib/libshaderc_shared.so.1''${LD_PRELOAD:+:$LD_PRELOAD}
|
||||||
|
|
||||||
|
exec ${davinci}/bin/resolve
|
||||||
|
''}";
|
||||||
|
|
||||||
|
# we inline extraInstallCommands instead of referencing orig.extraInstallCommands, as it is not exposed
|
||||||
|
extraInstallCommands = ''
|
||||||
|
mkdir -p $out/share/applications $out/share/icons/hicolor/128x128/apps
|
||||||
|
ln -s ${davinci}/share/applications/*.desktop $out/share/applications/
|
||||||
|
ln -s ${davinci}/graphics/DV_Resolve.png $out/share/icons/hicolor/128x128/apps/davinci-resolve${lib.optionalString studio-variant "-studio"}.png
|
||||||
|
'';
|
||||||
|
|
||||||
|
# we inline targetpkgs instead of referencing orig.targetpkgs, as it is not exposed
|
||||||
|
targetPkgs = pkgs-unstable: [
|
||||||
|
# our addition:
|
||||||
|
mesa-good-pkg
|
||||||
|
|
||||||
|
# original dependencies:
|
||||||
|
pkgs-unstable.alsa-lib
|
||||||
|
pkgs-unstable.aprutil
|
||||||
|
pkgs-unstable.bzip2
|
||||||
|
davinci
|
||||||
|
pkgs-unstable.dbus
|
||||||
|
pkgs-unstable.expat
|
||||||
|
pkgs-unstable.ffmpeg-full
|
||||||
|
pkgs-unstable.ffmpeg-full.lib
|
||||||
|
pkgs-unstable.fontconfig
|
||||||
|
pkgs-unstable.freetype
|
||||||
|
pkgs-unstable.glib
|
||||||
|
pkgs-unstable.shaderc.lib
|
||||||
|
pkgs-unstable.stdenv.cc.cc.lib
|
||||||
|
pkgs-unstable.libGL
|
||||||
|
pkgs-unstable.libGLU
|
||||||
|
pkgs-unstable.libarchive
|
||||||
|
pkgs-unstable.libcap
|
||||||
|
pkgs-unstable.librsvg
|
||||||
|
pkgs-unstable.libtool
|
||||||
|
pkgs-unstable.libuuid
|
||||||
|
pkgs-unstable.libxcrypt
|
||||||
|
pkgs-unstable.libxkbcommon
|
||||||
|
pkgs-unstable.nspr
|
||||||
|
pkgs-unstable.ocl-icd
|
||||||
|
pkgs-unstable.opencl-headers
|
||||||
|
pkgs-unstable.python3
|
||||||
|
pkgs-unstable.python3.pkgs.numpy
|
||||||
|
pkgs-unstable.udev
|
||||||
|
pkgs-unstable.vulkan-loader
|
||||||
|
pkgs-unstable.xdg-utils
|
||||||
|
pkgs-unstable.xorg.libICE
|
||||||
|
pkgs-unstable.xorg.libSM
|
||||||
|
pkgs-unstable.xorg.libX11
|
||||||
|
pkgs-unstable.xorg.libXcomposite
|
||||||
|
pkgs-unstable.xorg.libXcursor
|
||||||
|
pkgs-unstable.xorg.libXdamage
|
||||||
|
pkgs-unstable.xorg.libXext
|
||||||
|
pkgs-unstable.xorg.libXfixes
|
||||||
|
pkgs-unstable.xorg.libXi
|
||||||
|
pkgs-unstable.xorg.libXinerama
|
||||||
|
pkgs-unstable.xorg.libXrandr
|
||||||
|
pkgs-unstable.xorg.libXrender
|
||||||
|
pkgs-unstable.xorg.libXt
|
||||||
|
pkgs-unstable.xorg.libXtst
|
||||||
|
pkgs-unstable.xorg.libXxf86vm
|
||||||
|
pkgs-unstable.xorg.libxcb
|
||||||
|
pkgs-unstable.xorg.xcbutil
|
||||||
|
pkgs-unstable.xorg.xcbutilimage
|
||||||
|
pkgs-unstable.xorg.xcbutilkeysyms
|
||||||
|
pkgs-unstable.xorg.xcbutilrenderutil
|
||||||
|
pkgs-unstable.xorg.xcbutilwm
|
||||||
|
pkgs-unstable.xorg.xkeyboardconfig
|
||||||
|
pkgs-unstable.zlib
|
||||||
|
];
|
||||||
|
|
||||||
|
passthru = original.passthru;
|
||||||
|
meta = original.meta;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs-unstable; [ davinci-fixed ];
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user