feat(wrapping): introduce wrapped configurations

This commit is contained in:
Artur Manuel 2025-01-25 05:44:26 +00:00
commit 2aa24ab2b9
22 changed files with 883 additions and 135 deletions

View file

@ -3,6 +3,7 @@
packages = {
amadaluzian-starship = prev.callPackage ./derivations/starship.nix {};
amadaluzian-xonsh = prev.callPackage ./derivations/xonsh {inherit (packages) amadaluzian-starship;};
amadaluzian-nu = prev.callPackage ./derivations/nu {inherit (packages) amadaluzian-starship;};
fairfax = prev.callPackage ./derivations/fairfax.nix {};
river-bedload = prev.callPackage ./derivations/river-bedload {};
nicotine-plus = prev.symlinkJoin {

View file

@ -0,0 +1,22 @@
# config.nu
#
# Installed by:
# version = "0.101.0"
#
# This file is used to override default Nushell settings, define
# (or import) custom commands, or run any other startup tasks.
# See https://www.nushell.sh/book/configuration.html
#
# This file is loaded after env.nu and before login.nu
#
# You can open this file in your default editor using:
# config nu
#
# See `help config nu` for more options
#
# You can remove these comments if you want or leave
# them for future reference.
mkdir ($nu.data-dir | path join "vendor/autoload")
starship init nu | save -f ($nu.data-dir | path join "vendor/autoload/starship.nu")
zoxide init nushell | save -f ($nu.data-dir | path join "vendor/autoload/zoxide.nu")

View file

@ -0,0 +1,18 @@
# env.nu
#
# Installed by:
# version = "0.101.0"
#
# Previously, environment variables were typically configured in `env.nu`.
# In general, most configuration can and should be performed in `config.nu`
# or one of the autoload directories.
#
# This file is generated for backwards compatibility for now.
# It is loaded before config.nu and login.nu
#
# See https://www.nushell.sh/book/configuration.html
#
# Also see `help config env` for more options.
#
# You can remove these comments if you want or leave
# them for future reference.

View file

@ -0,0 +1,37 @@
{
symlinkJoin,
nushell,
amadaluzian-starship,
zoxide,
makeWrapper,
}:
symlinkJoin {
name = "nu";
paths = [
nushell
amadaluzian-starship
zoxide
];
nativeBuildInputs = [
makeWrapper
];
passthru = {
inherit (nushell.passthru) shellPath;
};
meta = {
inherit (nushell.meta) mainProgram;
};
postBuild = ''
wrapProgram $out/bin/nu \
--set NU_CONFIG_DIR "${./cfg}" \
--add-flags '--env-config' \
--add-flags '$NU_CONFIG_DIR/env.nu' \
--add-flags '--config' \
--add-flags '$NU_CONFIG_DIR/config.nu' \
'';
}

View file

@ -24,7 +24,7 @@
deno = {symbol = "deno ";};
directory = {
read_only = " ro";
format = ":[$path]($style)\\] ";
format = ":[$path]($style) ";
};
docker_context = {symbol = "docker ";};
dotnet = {symbol = ".NET ";};
@ -134,7 +134,7 @@
zig = {symbol = "zig ";};
username = {
show_always = true;
format = "\\[[$user]($style)@";
format = "[$user]($style)@";
};
hostname = {
ssh_only = false;

View file

@ -13,8 +13,8 @@
src = fetchFromGitHub {
owner = "amadaluzia";
repo = finalAttrs.pname;
rev = "master";
hash = "sha256-20egNKlJjJO1wdy1anApz0ADBnaHPUSqhfrsPe3QQIs=";
rev = "configurable-xonsh-dirs";
hash = "sha256-ynKPzw2MAp7wVXKHA8vZulJ+O9pJ+tvVc1c0wzlZICQ=";
};
});
};