Improve package
All checks were successful
build / build (push) Successful in 1m22s

This commit is contained in:
Torjus Håkestad 2024-11-28 23:23:52 +01:00
parent 0c723151cb
commit 72c2a27e5a
Signed by: torjus
SSH Key Fingerprint: SHA256:KjAds8wHfD2mBYK2H815s/+ABcSdcIHUndwHEdSxml4

View File

@ -86,7 +86,6 @@
dontConfigure = true; dontConfigure = true;
dontInstall = true; dontInstall = true;
buildPhase = '' buildPhase = ''
mypy --version
mkdir $out mkdir $out
mypy --strict huecli --junit-xml $out/junit.xml mypy --strict huecli --junit-xml $out/junit.xml
''; '';
@ -122,19 +121,27 @@
let let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
pythonSet = pythonSets.${system}; pythonSet = pythonSets.${system};
venv = pythonSet.mkVirtualEnv "huecli-env" workspace.deps.default;
in in
{ {
default = (pythonSet.mkVirtualEnv "huecli" workspace.deps.default).overrideAttrs ( default = pkgs.stdenv.mkDerivation {
_final: prev: { pname = "huecli";
nativeBuildInputs = prev.nativeBuildInputs ++ [ pkgs.installShellFiles ]; # TODO: Fix this, get version from pyproject
postInstall = '' version = "0.1.7";
installShellCompletion --cmd huecli \ dontConfigure = true;
--bash <($out/bin/huecli --show-completion bash) \ dontUnpack = true;
--zsh <($out/bin/huecli --show-completion zsh) \ dontBuild = true;
--fish <($out/bin/huecli --show-completion fish) buildInputs = [ venv ];
''; nativeBuildInputs = [ pkgs.installShellFiles ];
} postInstall = ''
); mkdir -p $out/bin
ln -s ${venv}/bin/huecli $out/bin/huecli
installShellCompletion --cmd huecli \
--bash <($out/bin/huecli --show-completion bash) \
--zsh <($out/bin/huecli --show-completion zsh) \
--fish <($out/bin/huecli --show-completion fish)
'';
};
} }
); );