[Buildroot] [PATCH v6 2/3] package/nushell: Add default configs

Sebastian Weyer sebastian.weyer at smile.fr
Wed Mar 8 13:15:52 UTC 2023


Automatically place default files for the nushell environment and
config in the appropriate folder to avoid the prompt at startup, asking
if you want to create them.

Signed-off-by: Sebastian Weyer <sebastian.weyer at smile.fr>
---
These default configs are optional and might not even be necessary, they
only prevent the prompt at the first startup of the shell
---
 package/nushell/nushell.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/package/nushell/nushell.mk b/package/nushell/nushell.mk
index b9c1ee6434..8ac3045c9f 100644
--- a/package/nushell/nushell.mk
+++ b/package/nushell/nushell.mk
@@ -10,6 +10,14 @@ NUSHELL_LICENSE = MIT
 NUSHELL_LICENSE_FILES = LICENSE
 NUSHELL_DEPENDENCIES = host-pkgconf openssl ncurses
 
+define NUSHELL_INSTALL_DEFAULT_CONFIG
+	$(INSTALL) -m 0644 -D $(@D)/crates/nu-utils/src/sample_config/default_config.nu \
+		$(TARGET_DIR)/root/.config/nushell/config.nu
+	$(INSTALL) -m 0644 -D $(@D)/crates/nu-utils/src/sample_config/default_env.nu \
+		$(TARGET_DIR)/root/.config/nushell/env.nu
+endef
+NUSHELL_POST_INSTALL_TARGET_HOOKS += NUSHELL_INSTALL_DEFAULT_CONFIG
+
 # Add /usr/bin/nu to /etc/shells as in package/bash/bash.mk
 define NUSHELL_ADD_NU_TO_SHELLS
 	grep -qsE '^/usr/bin/nu$$' $(TARGET_DIR)/etc/shells \
-- 
2.25.1




More information about the buildroot mailing list