Skip to content

Commit 132a513

Browse files
authoredMar 17, 2025
chore: create a programmatic listing of the commands that can be run (#1480)
* chore: create a programmtic listing of the commands that can be run * chore: deactivate sync-exts-versions * chore: deprecate old migrate-postgres command
1 parent ce5251d commit 132a513

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed
 

‎flake.nix

+17-2
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,21 @@
568568
wrapProgram $out/bin/dbmate-tool \
569569
--prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.overmind pkgs.dbmate pkgs.nix pkgs.jq pkgs.yq ]}
570570
'';
571+
show-commands = pkgs.runCommand "show-commands" {
572+
nativeBuildInputs = [ pkgs.makeWrapper ];
573+
buildInputs = [ pkgs.nushell ];
574+
} ''
575+
mkdir -p $out/bin
576+
cat > $out/bin/show-commands << 'EOF'
577+
#!${pkgs.nushell}/bin/nu
578+
let json_output = (nix flake show --json --quiet --all-systems | from json)
579+
let apps = ($json_output | get apps.${system})
580+
$apps | transpose name info | select name | each { |it| echo $"Run this app with: nix run .#($it.name)" }
581+
EOF
582+
chmod +x $out/bin/show-commands
583+
wrapProgram $out/bin/show-commands \
584+
--prefix PATH : ${pkgs.nushell}/bin
585+
'';
571586
update-readme = pkgs.runCommand "update-readme" {
572587
nativeBuildInputs = [ pkgs.makeWrapper ];
573588
buildInputs = [ pkgs.nushell ];
@@ -831,8 +846,8 @@
831846
start-server = mkApp "start-server" "start-postgres-server";
832847
start-client = mkApp "start-client" "start-postgres-client";
833848
start-replica = mkApp "start-replica" "start-postgres-replica";
834-
migrate-postgres = mkApp "migrate-tool" "migrate-postgres";
835-
sync-exts-versions = mkApp "sync-exts-versions" "sync-exts-versions";
849+
# migrate-postgres = mkApp "migrate-tool" "migrate-postgres";
850+
# sync-exts-versions = mkApp "sync-exts-versions" "sync-exts-versions";
836851
pg-restore = mkApp "pg-restore" "pg-restore";
837852
local-infra-bootstrap = mkApp "local-infra-bootstrap" "local-infra-bootstrap";
838853
dbmate-tool = mkApp "dbmate-tool" "dbmate-tool";

0 commit comments

Comments
 (0)
Failed to load comments.