nichts/packages/shell/default.nix

38 lines
1.1 KiB
Nix
Raw Normal View History

2024-11-01 15:54:20 +01:00
# This shell setup was inspired by sioodmy. Check out his setup!
2024-11-03 15:29:32 +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 {
2025-03-31 11:32:19 +02:00
name = "fish";
2024-11-02 11:28:08 +01:00
paths = [custom-fish] ++ packages;
nativeBuildInputs = [pkgs.makeWrapper];
2024-11-01 15:54:20 +01:00
postBuild = ''
wrapProgram $out/bin/fish --set STARSHIP_CONFIG "${toml.generate "starship.toml" starship-config}" \
'';
})
.overrideAttrs (_: {
passthru = {
shellPath = "/bin/fish";
};
})