From 32151a99d1f165956aba730543266b3ab409f6f0 Mon Sep 17 00:00:00 2001 From: atagen Date: Thu, 6 Feb 2025 11:28:02 +1100 Subject: [PATCH] make autorun optional squash --- default.nix | 14 ++++++-------- ides.nix | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/default.nix b/default.nix index 981c1b5..a9e9c90 100644 --- a/default.nix +++ b/default.nix @@ -3,6 +3,7 @@ pkgs ? import , shell ? pkgs.mkShell, modules ? [ ], + auto ? true, ... }: # shell creation args @@ -28,14 +29,11 @@ let # ides ./ides.nix # service config and build params - ( - _: - { - inherit services; - _buildIdes.shellFn = shell; - _buildIdes.shellArgs = shellArgs; - } - ) + (_: { + inherit services auto; + _buildIdes.shellFn = shell; + _buildIdes.shellArgs = shellArgs; + }) ] ++ baseModules ++ modules diff --git a/ides.nix b/ides.nix index 7475963..f782615 100644 --- a/ides.nix +++ b/ides.nix @@ -330,10 +330,20 @@ restart ]; shellHook = + let + autoRun = + if config.auto then + '' + ides run + '' + else + ""; + in (shellArgs.shellHook or "") + '' - ides - ''; + ides help + '' + + autoRun; }; in config._buildIdes.shellFn final;