1
0
forked from clan/clan-core

devShells: make all shells inherit from default shell

Currently, important tools from the default shell are lost as soon as select-shell is used to switch to another shell. select-shell itself, for example is missing, which makes it impossible to switch back to another shell.
This commit is contained in:
DavHau 2024-07-05 15:00:13 +07:00
parent a89b301425
commit 802f047341
8 changed files with 36 additions and 7 deletions

View File

@ -74,9 +74,12 @@
{ {
devShells.docs = pkgs.callPackage ./shell.nix { devShells.docs = pkgs.callPackage ./shell.nix {
inherit (self'.packages) docs clan-cli-docs; inherit (self'.packages) docs clan-cli-docs;
inherit module-docs; inherit
inherit asciinema-player-js; asciinema-player-js
inherit asciinema-player-css; asciinema-player-css
module-docs
self'
;
}; };
packages = { packages = {
docs = pkgs.python3.pkgs.callPackage ./default.nix { docs = pkgs.python3.pkgs.callPackage ./default.nix {

View File

@ -7,10 +7,14 @@
asciinema-player-css, asciinema-player-css,
roboto, roboto,
fira-code, fira-code,
self',
... ...
}: }:
pkgs.mkShell { pkgs.mkShell {
inputsFrom = [ docs ]; inputsFrom = [
docs
self'.devShells.default
];
shellHook = '' shellHook = ''
mkdir -p ./site/reference/cli mkdir -p ./site/reference/cli
cp -af ${module-docs}/* ./site/reference/ cp -af ${module-docs}/* ./site/reference/

View File

@ -13,6 +13,7 @@ in
lib, lib,
config, config,
system, system,
self',
... ...
}: }:
let let
@ -26,6 +27,7 @@ in
inputsFrom = with config.checks; [ inputsFrom = with config.checks; [
lib-inventory-schema lib-inventory-schema
lib-inventory-eval lib-inventory-eval
self'.devShells.default
]; ];
}; };

View File

@ -6,6 +6,7 @@
pkgs, pkgs,
lib, lib,
system, system,
self',
... ...
}: }:
if lib.elem system lib.platforms.darwin then if lib.elem system lib.platforms.darwin then
@ -14,6 +15,7 @@
{ {
devShells.clan-app = pkgs.callPackage ./shell.nix { devShells.clan-app = pkgs.callPackage ./shell.nix {
inherit (config.packages) clan-app webview-ui; inherit (config.packages) clan-app webview-ui;
inherit self';
}; };
packages.clan-app = pkgs.python3.pkgs.callPackage ./default.nix { packages.clan-app = pkgs.python3.pkgs.callPackage ./default.nix {
inherit (config.packages) clan-cli webview-ui; inherit (config.packages) clan-cli webview-ui;

View File

@ -11,6 +11,7 @@
gtk4, gtk4,
libadwaita, libadwaita,
webview-ui, webview-ui,
self',
}: }:
let let
@ -27,6 +28,9 @@ let
in in
mkShell { mkShell {
inherit (clan-app) nativeBuildInputs; inherit (clan-app) nativeBuildInputs;
inputsFrom = [ self'.devShells.default ];
buildInputs = buildInputs =
[ [
ruff ruff

View File

@ -39,7 +39,10 @@
in in
{ {
devShells.clan-cli = pkgs.callPackage ./shell.nix { inherit (self'.packages) clan-cli; }; devShells.clan-cli = pkgs.callPackage ./shell.nix {
inherit (self'.packages) clan-cli;
inherit self';
};
packages = { packages = {
clan-cli = pkgs.python3.pkgs.callPackage ./default.nix { clan-cli = pkgs.python3.pkgs.callPackage ./default.nix {
inherit (inputs) nixpkgs; inherit (inputs) nixpkgs;

View File

@ -4,6 +4,7 @@
mkShell, mkShell,
ruff, ruff,
python3, python3,
self',
}: }:
let let
devshellTestDeps = devshellTestDeps =
@ -22,6 +23,8 @@ mkShell {
ruff ruff
] ++ devshellTestDeps; ] ++ devshellTestDeps;
inputsFrom = [ self'.devShells.default ];
PYTHONBREAKPOINT = "ipdb.set_trace"; PYTHONBREAKPOINT = "ipdb.set_trace";
shellHook = '' shellHook = ''

View File

@ -1,7 +1,12 @@
{ ... }: { ... }:
{ {
perSystem = perSystem =
{ pkgs, config, ... }: {
pkgs,
config,
self',
...
}:
{ {
packages.webview-ui = pkgs.buildNpmPackage { packages.webview-ui = pkgs.buildNpmPackage {
pname = "clan-webview-ui"; pname = "clan-webview-ui";
@ -22,7 +27,10 @@
''; '';
}; };
devShells.webview-ui = pkgs.mkShell { devShells.webview-ui = pkgs.mkShell {
inputsFrom = [ config.packages.webview-ui ]; inputsFrom = [
config.packages.webview-ui
self'.devShells.default
];
shellHook = '' shellHook = ''
mkdir -p ./app/api mkdir -p ./app/api
cat ${config.packages.clan-ts-api} > ./app/api/index.ts cat ${config.packages.clan-ts-api} > ./app/api/index.ts