Merge pull request 'fix uneccessary clan-cli rebuilds by not relying on self' (#197) from Mic92-main into main

This commit is contained in:
clan-bot
2023-08-27 08:22:42 +00:00
3 changed files with 10 additions and 13 deletions

View File

@@ -12,7 +12,6 @@
, pytest-parallel , pytest-parallel
, python3 , python3
, runCommand , runCommand
, self
, setuptools , setuptools
, sops , sops
, stdenv , stdenv
@@ -50,8 +49,8 @@ let
cp -r ${./.} $out cp -r ${./.} $out
chmod -R +w $out chmod -R +w $out
rm $out/clan_cli/config/jsonschema rm $out/clan_cli/config/jsonschema
cp -r ${self + /lib/jsonschema} $out/clan_cli/config/jsonschema
ln -s ${nixpkgs} $out/clan_cli/nixpkgs ln -s ${nixpkgs} $out/clan_cli/nixpkgs
cp -r ${../../lib/jsonschema} $out/clan_cli/config/jsonschema
ln -s ${ui-assets} $out/clan_cli/webui/assets ln -s ${ui-assets} $out/clan_cli/webui/assets
''; '';
nixpkgs = runCommand "nixpkgs" { } '' nixpkgs = runCommand "nixpkgs" { } ''

View File

@@ -1,12 +1,10 @@
{ self, ... }: { {
perSystem = { self', pkgs, ... }: { perSystem = { self', pkgs, ... }: {
devShells.clan-cli = pkgs.callPackage ./shell.nix { devShells.clan-cli = pkgs.callPackage ./shell.nix {
inherit self; inherit (self'.packages) clan-cli ui-assets nix-unit;
inherit (self'.packages) clan-cli ui-assets;
}; };
packages = { packages = {
clan-cli = pkgs.python3.pkgs.callPackage ./default.nix { clan-cli = pkgs.python3.pkgs.callPackage ./default.nix {
inherit self;
inherit (self'.packages) ui-assets zerotierone; inherit (self'.packages) ui-assets zerotierone;
}; };
clan-openapi = self'.packages.clan-cli.clan-openapi; clan-openapi = self'.packages.clan-cli.clan-openapi;

View File

@@ -1,6 +1,6 @@
{ self, clan-cli, pkgs, ui-assets }: { nix-unit, clan-cli, ui-assets, python3, system, ruff, mkShell, writeScriptBin }:
let let
pythonWithDeps = pkgs.python3.withPackages ( pythonWithDeps = python3.withPackages (
ps: ps:
clan-cli.propagatedBuildInputs clan-cli.propagatedBuildInputs
++ clan-cli.devDependencies ++ clan-cli.devDependencies
@@ -8,14 +8,14 @@ let
ps.pip ps.pip
] ]
); );
checkScript = pkgs.writeScriptBin "check" '' checkScript = writeScriptBin "check" ''
nix build .#checks.${pkgs.system}.{treefmt,clan-pytest} -L "$@" nix build .#checks.${system}.{treefmt,clan-pytest} -L "$@"
''; '';
in in
pkgs.mkShell { mkShell {
packages = [ packages = [
pkgs.ruff ruff
self.packages.${pkgs.system}.nix-unit nix-unit
pythonWithDeps pythonWithDeps
]; ];
# sets up an editable install and add enty points to $PATH # sets up an editable install and add enty points to $PATH