build(nix): add package derivation for tshell

This commit is contained in:
tux
2026-08-24 20:38:17 +05:30
parent 51906373aa
commit 4453c280bf
2 changed files with 76 additions and 1 deletions

View File

@@ -42,9 +42,16 @@
};
};
in
{
rec {
formatter.${system} = treefmtEval.config.build.wrapper;
packages.${system} = {
tshell = pkgs.callPackage ./package.nix {
inherit quickshellWithModules;
};
default = packages.${system}.tshell;
};
devShells.${system}.default = pkgs.mkShell {
packages = [
quickshellWithModules

68
package.nix Normal file
View File

@@ -0,0 +1,68 @@
{
lib,
stdenv,
makeWrapper,
makeFontsConf,
quickshellWithModules,
cava,
wallust,
nerd-fonts,
extraRuntimeDeps ? [ ],
}:
let
version = "0.1.0";
runtimeDeps = [
cava
wallust
]
++ extraRuntimeDeps;
fontconfig = makeFontsConf {
fontDirectories = [ nerd-fonts.fira-code ];
};
in
stdenv.mkDerivation {
inherit version;
pname = "tshell";
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions [
./shell.qml
./assets
./config
./modules
./services
./ui
./windows
];
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ quickshellWithModules ];
propagatedBuildInputs = runtimeDeps;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/tshell
cp -r . $out/share/tshell
makeWrapper ${quickshellWithModules}/bin/qs $out/bin/tshell \
--prefix PATH : "${lib.makeBinPath runtimeDeps}" \
--set FONTCONFIG_FILE "${fontconfig}" \
--add-flags "-p $out/share/tshell"
runHook postInstall
'';
meta = {
description = "tux's widgets for wayland";
homepage = "https://github.com/tuxdotrs/tshell";
license = lib.licenses.gpl3Only;
mainProgram = "tshell";
platforms = lib.platforms.linux;
};
}