clan-cli: stop propagating build inputs, remove wrapper
This commit is contained in:
parent
c0e2bfbcb8
commit
017221febb
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
treefmt.programs.mypy.enable = true;
|
treefmt.programs.mypy.enable = true;
|
||||||
treefmt.programs.mypy.directories = {
|
treefmt.programs.mypy.directories = {
|
||||||
"pkgs/clan-cli".extraPythonPackages = self'.packages.clan-cli-unwrapped.pytestDependencies;
|
"pkgs/clan-cli".extraPythonPackages = self'.packages.clan-cli.pytestDependencies;
|
||||||
};
|
};
|
||||||
|
|
||||||
treefmt.settings.formatter.nix = {
|
treefmt.settings.formatter.nix = {
|
||||||
|
|
|
@ -152,6 +152,11 @@ python3.pkgs.buildPythonApplication {
|
||||||
installShellCompletion --fish --name clan.fish \
|
installShellCompletion --fish --name clan.fish \
|
||||||
<(${argcomplete}/bin/register-python-argcomplete --shell fish clan)
|
<(${argcomplete}/bin/register-python-argcomplete --shell fish clan)
|
||||||
'';
|
'';
|
||||||
|
# Don't leak python packages into a devshell.
|
||||||
|
# It can be very confusing if you `nix run` than load the cli from the devshell instead.
|
||||||
|
postFixup = ''
|
||||||
|
rm $out/nix-support/propagated-build-inputs
|
||||||
|
'';
|
||||||
checkPhase = ''
|
checkPhase = ''
|
||||||
PYTHONPATH= $out/bin/clan --help
|
PYTHONPATH= $out/bin/clan --help
|
||||||
if grep --include \*.py -Rq "breakpoint()" $out; then
|
if grep --include \*.py -Rq "breakpoint()" $out; then
|
||||||
|
|
|
@ -2,24 +2,18 @@
|
||||||
{
|
{
|
||||||
perSystem = { self', pkgs, ... }: {
|
perSystem = { self', pkgs, ... }: {
|
||||||
devShells.clan-cli = pkgs.callPackage ./shell.nix {
|
devShells.clan-cli = pkgs.callPackage ./shell.nix {
|
||||||
inherit (self'.packages) clan-cli-unwrapped ui-assets nix-unit;
|
inherit (self'.packages) clan-cli ui-assets nix-unit;
|
||||||
};
|
};
|
||||||
packages = {
|
packages = {
|
||||||
clan-cli-unwrapped = pkgs.python3.pkgs.callPackage ./default.nix {
|
clan-cli = pkgs.python3.pkgs.callPackage ./default.nix {
|
||||||
inherit (self'.packages) ui-assets;
|
inherit (self'.packages) ui-assets;
|
||||||
inherit (inputs) nixpkgs;
|
inherit (inputs) nixpkgs;
|
||||||
};
|
};
|
||||||
# Don't leak python packages into a devshell.
|
inherit (self'.packages.clan-cli) clan-openapi;
|
||||||
# It can be very confusing if you `nix run` than than load the cli from the devshell instead.
|
|
||||||
clan-cli = pkgs.runCommand "clan" { } ''
|
|
||||||
mkdir $out
|
|
||||||
ln -s ${self'.packages.clan-cli-unwrapped}/bin $out
|
|
||||||
'';
|
|
||||||
inherit (self'.packages.clan-cli-unwrapped) clan-openapi;
|
|
||||||
default = self'.packages.clan-cli;
|
default = self'.packages.clan-cli;
|
||||||
};
|
};
|
||||||
|
|
||||||
checks = self'.packages.clan-cli-unwrapped.tests;
|
checks = self'.packages.clan-cli.tests;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ nix-unit, clan-cli-unwrapped, ui-assets, system, mkShell, writeScriptBin, openssh }:
|
{ nix-unit, clan-cli, ui-assets, system, mkShell, writeScriptBin, openssh }:
|
||||||
let
|
let
|
||||||
checkScript = writeScriptBin "check" ''
|
checkScript = writeScriptBin "check" ''
|
||||||
nix build .#checks.${system}.{treefmt,clan-pytest} -L "$@"
|
nix build .#checks.${system}.{treefmt,clan-pytest} -L "$@"
|
||||||
|
@ -8,14 +8,14 @@ mkShell {
|
||||||
packages = [
|
packages = [
|
||||||
nix-unit
|
nix-unit
|
||||||
openssh
|
openssh
|
||||||
clan-cli-unwrapped.checkPython
|
clan-cli.checkPython
|
||||||
];
|
];
|
||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
tmp_path=$(realpath ./.direnv)
|
tmp_path=$(realpath ./.direnv)
|
||||||
|
|
||||||
rm -f clan_cli/nixpkgs clan_cli/webui/assets
|
rm -f clan_cli/nixpkgs clan_cli/webui/assets
|
||||||
ln -sf ${clan-cli-unwrapped.nixpkgs} clan_cli/nixpkgs
|
ln -sf ${clan-cli.nixpkgs} clan_cli/nixpkgs
|
||||||
ln -sf ${ui-assets} clan_cli/webui/assets
|
ln -sf ${ui-assets} clan_cli/webui/assets
|
||||||
|
|
||||||
export PATH="$tmp_path/bin:${checkScript}/bin:$PATH"
|
export PATH="$tmp_path/bin:${checkScript}/bin:$PATH"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user