From 3cb91769cada8328a1993839f3642fcb9a679b36 Mon Sep 17 00:00:00 2001 From: DavHau Date: Wed, 25 Jun 2025 12:33:36 +0700 Subject: [PATCH] nix_modules: generate clan.py in top-level shell Generally I don't think dev shells are the right place to trigger generation of files. This should be part of the formatter and pre-commit hook @hsjobeki --- devShell.nix | 3 +++ pkgs/clan-cli/shell.nix | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/devShell.nix b/devShell.nix index d3fcd9dd6..117b4fcc6 100644 --- a/devShell.nix +++ b/devShell.nix @@ -44,6 +44,9 @@ # vendoring / needed for impure tests ln -sfT ${self'.packages.clan-cli.nixpkgs} "$PRJ_ROOT/pkgs/clan-cli/clan_lib/nixpkgs" ln -sfT ${inputs.nix-select} "$PRJ_ROOT/pkgs/clan-cli/clan_lib/select" + + # Generate classes.py from schemas + ${self'.packages.classgen}/bin/classgen ${self'.legacyPackages.schemas.clan-schema-abstract}/schema.json $PRJ_ROOT/pkgs/clan-cli/clan_lib/nix_models/clan.py ''; }; }; diff --git a/pkgs/clan-cli/shell.nix b/pkgs/clan-cli/shell.nix index 74cab1fce..55932e004 100644 --- a/pkgs/clan-cli/shell.nix +++ b/pkgs/clan-cli/shell.nix @@ -45,8 +45,5 @@ mkShell { # Add clan command to PATH export PATH="$PKG_ROOT/bin":"$PATH" - - # Generate classes.py from schemas - ${self'.packages.classgen}/bin/classgen ${self'.legacyPackages.schemas.clan-schema-abstract}/schema.json $PKG_ROOT/clan_lib/nix_models/clan.py ''; }