add poweshell

This commit is contained in:
Sridhar Ratnakumar 2023-04-16 13:28:30 -04:00
parent dca6a7ba97
commit 4f8ff49764
2 changed files with 22 additions and 0 deletions

View file

@ -12,6 +12,7 @@
./direnv.nix
./zellij.nix
# ./nushell.nix (intergrates extremely poorly with the system)
./powershell.nix
];
};
common-linux = {

21
home/powershell.nix Normal file
View file

@ -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)
})
'';
}