nixos/modules/packages/nushell.nix

48 lines
1.4 KiB
Nix
Raw Normal View History

2024-08-29 22:26:24 +08:00
inputs:
{
options.nixos.packages.nushell = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule {});
default = {};
};
config = let inherit (inputs.config.nixos.packages) nushell; in inputs.lib.mkIf (nushell != null)
{
nixos =
{
packages.packages._packages = [ inputs.pkgs.nushell ];
user.sharedModules =
[{
config.programs =
{
nushell =
{
enable = true;
2024-08-30 19:09:07 +08:00
extraConfig = "source ${inputs.topInputs.nu-scripts}/aliases/git/git-aliases.nu";
};
2024-08-29 22:26:24 +08:00
carapace.enable = true;
oh-my-posh =
{
enable = true;
enableZshIntegration = false;
settings = inputs.localLib.deepReplace
[
{
path = [ "blocks" 0 "segments" (v: v.type or "" == "path") "properties" "style" ];
value = "powerlevel";
}
{
path = [ "blocks" 0 "segments" (v: v.type or "" == "executiontime") "template" ];
2024-08-30 18:56:56 +08:00
value = v: builtins.replaceStrings [ "" ] [ " " ] v;
2024-08-29 22:26:24 +08:00
}
]
(builtins.fromJSON (builtins.readFile
"${inputs.pkgs.oh-my-posh}/share/oh-my-posh/themes/atomic.omp.json"));
};
2024-08-30 20:10:39 +08:00
zoxide.enable = true;
2024-08-29 22:26:24 +08:00
direnv.enable = true;
};
}];
};
};
}