split shaders into separate derivation for incremental builds
This commit is contained in:
parent
c55ddd95b5
commit
195dd37be5
3 changed files with 58 additions and 28 deletions
|
|
@ -57,12 +57,13 @@
|
|||
withI3 = false;
|
||||
};
|
||||
nova-stats = pkgs.callPackage ./nix/stats-daemon.nix { };
|
||||
nova-shaders = pkgs.callPackage ./nix/shaders.nix { };
|
||||
in
|
||||
rec {
|
||||
inherit nova-stats;
|
||||
inherit nova-stats nova-shaders;
|
||||
nova-shell = pkgs.callPackage ./nix/package.nix {
|
||||
quickshell = qs;
|
||||
inherit nova-stats;
|
||||
inherit nova-stats nova-shaders;
|
||||
};
|
||||
nova-shell-cli = pkgs.runCommand "nova-shell-cli" { nativeBuildInputs = [ pkgs.makeWrapper ]; } ''
|
||||
mkdir -p $out/bin
|
||||
|
|
|
|||
|
|
@ -1,40 +1,46 @@
|
|||
{
|
||||
lib,
|
||||
stdenvNoCC,
|
||||
symlinkJoin,
|
||||
makeWrapper,
|
||||
quickshell,
|
||||
qt6,
|
||||
nova-stats,
|
||||
nova-shaders,
|
||||
glib,
|
||||
}:
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "nova-shell";
|
||||
let
|
||||
shellSrc = lib.cleanSourceWith {
|
||||
src = lib.cleanSource ../.;
|
||||
filter = path: _type: !(lib.hasSuffix ".frag" path);
|
||||
};
|
||||
|
||||
shell = stdenvNoCC.mkDerivation {
|
||||
pname = "nova-shell-qml";
|
||||
version = "0.1.0";
|
||||
|
||||
src = lib.cleanSource ../.;
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
qt6.qtshadertools
|
||||
];
|
||||
src = shellSrc;
|
||||
|
||||
dontBuild = true;
|
||||
dontWrapQtApps = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/share/nova-shell
|
||||
cp -r shell/shell.qml shell/modules shell/services shell/applets shell/lock shell/assets $out/share/nova-shell/
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
in
|
||||
symlinkJoin {
|
||||
name = "nova-shell-0.1.0";
|
||||
|
||||
# Compile fragment shaders to Qt RHI format
|
||||
qsb --qt6 \
|
||||
-o $out/share/nova-shell/modules/hex_wave.frag.qsb \
|
||||
shell/modules/hex_wave.frag
|
||||
qsb --qt6 \
|
||||
-o $out/share/nova-shell/modules/reveal_mask.frag.qsb \
|
||||
shell/modules/reveal_mask.frag
|
||||
paths = [
|
||||
shell
|
||||
nova-shaders
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
postBuild = ''
|
||||
mkdir -p $out/bin
|
||||
makeWrapper ${lib.getExe quickshell} $out/bin/nova-shell \
|
||||
--add-flags "-p $out/share/nova-shell/shell.qml" \
|
||||
|
|
@ -44,8 +50,6 @@ stdenvNoCC.mkDerivation {
|
|||
glib
|
||||
]
|
||||
}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
|
|
|
|||
25
nix/shaders.nix
Normal file
25
nix/shaders.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
lib,
|
||||
stdenvNoCC,
|
||||
qt6,
|
||||
}:
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "nova-shell-shaders";
|
||||
version = "0.1.0";
|
||||
|
||||
src = lib.sourceFilesBySuffices (lib.cleanSource ../shell/modules) [ ".frag" ];
|
||||
|
||||
nativeBuildInputs = [ qt6.qtshadertools ];
|
||||
|
||||
dontBuild = true;
|
||||
dontWrapQtApps = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/share/nova-shell/modules
|
||||
for f in *.frag; do
|
||||
qsb --qt6 -o "$out/share/nova-shell/modules/''${f}.qsb" "$f"
|
||||
done
|
||||
runHook postInstall
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue