From 4f8ff497643cfdb2154fccf5566a2e6cdba4b1c5 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Sun, 16 Apr 2023 13:28:30 -0400 Subject: [PATCH] add poweshell --- home/default.nix | 1 + home/powershell.nix | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 home/powershell.nix diff --git a/home/default.nix b/home/default.nix index 942378e..1b26fe7 100644 --- a/home/default.nix +++ b/home/default.nix @@ -12,6 +12,7 @@ ./direnv.nix ./zellij.nix # ./nushell.nix (intergrates extremely poorly with the system) + ./powershell.nix ]; }; common-linux = { diff --git a/home/powershell.nix b/home/powershell.nix new file mode 100644 index 0000000..8f0e420 --- /dev/null +++ b/home/powershell.nix @@ -0,0 +1,21 @@ +{ pkgs, ... }: + +# TODO: Upstream as home-manager module: https://github.com/nix-community/home-manager/issues/2890 +# +# FIXME: Powershell launch is quite slow, on macOS. So not using it as default shell. +{ + home.packages = with pkgs; [ + powershell + ]; + + home.file.".config/powershell/Microsoft.PowerShell_profile.ps1".text = '' + # starship + Invoke-Expression (&starship init powershell) + + # zoxide + Invoke-Expression (& { + $hook = if ($PSVersionTable.PSVersion.Major -lt 6) { 'prompt' } else { 'pwd' } + (zoxide init --hook $hook powershell | Out-String) + }) + ''; +}