38 lines
1 KiB
Nix
38 lines
1 KiB
Nix
# This shell setup was inspired by sioodmy. Check out his setup!
|
|
{pkgs, ...}: let
|
|
toml = pkgs.formats.toml {};
|
|
starship-config = import ./starship.nix;
|
|
aliases = import ./aliases.nix {inherit pkgs;};
|
|
|
|
fishinit = import ./fishinit.nix {inherit pkgs aliasesStr;};
|
|
|
|
aliasesStr =
|
|
mapAttrsToList (k: v: "alias ${k}=\"${v}\"") aliases
|
|
|> concatStringsSep "\n";
|
|
|
|
packages = import ./packages.nix pkgs;
|
|
|
|
# this was taken from viperml, check out his config for this!
|
|
custom-fish = pkgs.fish.overrideAttrs (old: {
|
|
patches = [./fish-on-tmpfs.patch];
|
|
doCheck = false;
|
|
postInstall =
|
|
old.postInstall
|
|
+ ''
|
|
echo "source ${fishinit}" >> $out/etc/fish/config.fish
|
|
'';
|
|
});
|
|
in
|
|
(pkgs.symlinkJoin {
|
|
name = "fish";
|
|
paths = [custom-fish] ++ packages;
|
|
nativeBuildInputs = [pkgs.makeWrapper];
|
|
postBuild = ''
|
|
wrapProgram $out/bin/fish --set STARSHIP_CONFIG "${toml.generate "starship.toml" starship-config}" \
|
|
'';
|
|
})
|
|
.overrideAttrs (_: {
|
|
passthru = {
|
|
shellPath = "/bin/fish";
|
|
};
|
|
})
|