2024-11-01 15:54:20 +01:00
|
|
|
# This shell setup was inspired by sioodmy. Check out his setup!
|
2024-11-02 12:38:44 +01:00
|
|
|
{
|
2024-11-02 17:45:34 +01:00
|
|
|
inputs,
|
2024-11-02 12:38:44 +01:00
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
2024-11-01 15:54:20 +01:00
|
|
|
toml = pkgs.formats.toml {};
|
|
|
|
starship-config = import ./starship.nix;
|
|
|
|
aliases = import ./aliases.nix {inherit pkgs;};
|
|
|
|
|
|
|
|
fishinit = import ./fishinit.nix {inherit pkgs aliasesStr;};
|
|
|
|
|
|
|
|
aliasesStr =
|
|
|
|
pkgs.lib.concatStringsSep "\n"
|
|
|
|
(pkgs.lib.mapAttrsToList (k: v: "alias ${k}=\"${v}\"") aliases);
|
|
|
|
packages = import ./packages.nix pkgs;
|
2024-11-02 11:28:08 +01:00
|
|
|
|
|
|
|
# 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
|
|
|
|
'';
|
|
|
|
});
|
2024-11-01 15:54:20 +01:00
|
|
|
in
|
|
|
|
(pkgs.symlinkJoin {
|
|
|
|
name = "fish-wrapped";
|
2024-11-02 11:28:08 +01:00
|
|
|
paths = [custom-fish] ++ packages;
|
2024-11-01 15:54:20 +01:00
|
|
|
buildInputs = [pkgs.makeWrapper];
|
|
|
|
postBuild = ''
|
|
|
|
wrapProgram $out/bin/fish --set STARSHIP_CONFIG "${toml.generate "starship.toml" starship-config}" \
|
2024-11-01 20:55:25 +01:00
|
|
|
--set SSH_AUTH_SOCK /run/user/1000/ssh-agent \
|
2024-11-01 15:54:20 +01:00
|
|
|
'';
|
|
|
|
})
|
|
|
|
.overrideAttrs (_: {
|
|
|
|
passthru = {
|
|
|
|
shellPath = "/bin/fish";
|
|
|
|
};
|
|
|
|
})
|