wrapeprs/fish: cleanup

This commit is contained in:
Nikodem Rabuliński 2024-02-10 17:16:34 +01:00
parent fc4185d65e
commit 742e18c376
4 changed files with 35 additions and 46 deletions

View file

@ -4,16 +4,9 @@
inputs',
...
}: let
argsModule = {
_module.args = {
inherit inputs';
inherit inputs;
};
};
wrapped = inputs.wrapper-manager-hm-compat.lib {
inherit pkgs;
modules = [
argsModule
# ./starship
./helix
# TODO: Enable again
@ -21,20 +14,13 @@
./fish
./wezterm
];
specialArgs = {
inherit inputs inputs';
};
};
all-packages = wrapped.config.build.packages;
fish-base = pkgs.fish;
fish-wrapped = all-packages.fish;
fish = pkgs.symlinkJoin {
inherit (fish-base) name meta passthru;
paths = [fish-wrapped fish-base];
};
in {
packages =
all-packages
// {
inherit fish;
};
all-packages;
};
}

View file

@ -1,33 +1,33 @@
{
config,
lib,
pkgs,
...
}: {
# TODO: Fix once https://github.com/viperML/wrapper-manager/issues/14 is resolved
wrappers.fish = {
basePackage = pkgs.runCommandNoCC "fish-binary" {} ''
install -D -m555 ${lib.getExe pkgs.fish} "$out/bin/fish"
'';
extraWrapperFlags = "--inherit-argv0";
basePackage = pkgs.fish;
wrapByDefault = false;
prependFlags = let
# Can't rely on pathAdd because fish used as login shell will ignore the variables the wrapper sets up
path-add-lines =
lib.concatMapStringsSep "\n"
(pkg: "fish_add_path --path --prepend '${lib.getExe' pkg ""}'")
config.wrappers.fish.pathAdd;
config-fish = pkgs.writeText "config.fish" ''
${path-add-lines}
programs.fish = {config, ...}: {
extraWrapperFlags = "--inherit-argv0";
source ${./prompt.fish}
source ${./config.fish}
'';
in [
"-C"
"source ${config-fish}"
];
prependFlags = let
# Can't rely on pathAdd because fish used as login shell will ignore the variables the wrapper sets up
path-add-lines =
lib.concatMapStringsSep "\n"
(pkg: "fish_add_path --path --prepend '${lib.getExe' pkg ""}'")
config.pathAdd;
config-fish = pkgs.writeText "config.fish" ''
${path-add-lines}
pathAdd = with pkgs; [eza bat fzf ripgrep zoxide direnv];
source ${./prompt.fish}
source ${./config.fish}
'';
in [
"-C"
"source ${config-fish}"
];
pathAdd = with pkgs; [eza bat fzf ripgrep zoxide direnv];
};
};
}