Skip to content

Commit

Permalink
keychain: add nushell integration
Browse files Browse the repository at this point in the history
  • Loading branch information
CardboardTurkey committed Feb 14, 2023
1 parent 2dce7f1 commit da72e6f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions modules/programs/keychain.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ in {
'';
};

enableNushellIntegration = mkOption {
default = true;
type = types.bool;
description = ''
Whether to enable Nushell integration.
'';
};

enableXsessionIntegration = mkOption {
default = true;
type = types.bool;
Expand All @@ -108,6 +116,9 @@ in {
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
eval "$(SHELL=zsh ${shellCommand})"
'';
programs.nushell.extraConfig = mkIf cfg.enableNushellIntegration ''
${shellCommand} | parse -r '(\w+)=(.*); export \1' | transpose -ird | load-env
'';
xsession.initExtra = mkIf cfg.enableXsessionIntegration ''
eval "$(${shellCommand})"
'';
Expand Down

0 comments on commit da72e6f

Please sign in to comment.