From c744c2a2f8986adef018c6ee10dbfcf0471432a5 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 26 Jan 2025 12:30:29 +0800 Subject: [PATCH] home-manager/programs/nushell: init extension module --- modules/home-manager/default.nix | 1 + modules/home-manager/programs/nushell.nix | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 modules/home-manager/programs/nushell.nix diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 33bbcade..75bc2666 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -4,6 +4,7 @@ ./programs/pipewire.nix ./programs/pop-launcher.nix ./programs/borgmatic.nix + ./programs/nushell.nix ./programs/python.nix ./services/archivebox.nix ./services/borgbackup.nix diff --git a/modules/home-manager/programs/nushell.nix b/modules/home-manager/programs/nushell.nix new file mode 100644 index 00000000..886d41cf --- /dev/null +++ b/modules/home-manager/programs/nushell.nix @@ -0,0 +1,15 @@ +# This is just an extended implementation of exporting Nushell session +# variables since the one from home-manager is only in POSIX sh script. +{ config, lib, pkgs, ... }: + +let + cfg = config.programs.nushell; +in +{ + config.programs.nushell.extraEnv = let + exportSessionVariables = lib.mapAttrs (n: v: + "$env.${n} = ${v}") config.home.sessionVariables; + in lib.mkBefore '' + ${exportSessionVariables} + ''; +}