{ lib, ... }:
let
  # why not just use functions normally? ctrl-alt-e is why!
  _tmpfn_name_ = "_tmpfn_ex4aiNgu_"; # pwgen ftw
  mkArgsAlias = alias: ''${_tmpfn_name_}() { unset -f ${_tmpfn_name_}; ${alias}; }; ${_tmpfn_name_}'';
in
{
  home.shellAliases = {
    denix = "sed -E 's@/nix/store/[^ /]+@@g'";
    denix-ellipsis = "sed -E 's@/nix/store/[^ /-]+-?@/nix/store/...@g'";

    # nix-eval = "nix eval --impure --expr";
    # nix-eval-nixpkgs = mkArgsAlias ''nix eval --impure --expr "with import (builtins.getFlake "nixpkgs") {}; $1" "''${@:2}"'';

    # if nom is not in path we rely on bash to let us know that if we attempt to use it

    nom-instantiate = "nix-instantiate";

    inom  = mkArgsAlias ''nom "$@" --system i686-linux -j0'';
    inix  = mkArgsAlias ''nix "$@" --system i686-linux -j0'';
    rnom  = mkArgsAlias ''nom "$@" --system riscv64-linux -j0'';
    rnix  = mkArgsAlias ''nix "$@" --system riscv64-linux -j0'';
    fnom  = mkArgsAlias ''nom "$@" --system x86_64-freebsd -j0'';
    fnix  = mkArgsAlias ''nix "$@" --system x86_64-freebsd -j0'';
    fanom  = mkArgsAlias ''nom "$@" --system aarch64-freebsd -j0'';
    fanix  = mkArgsAlias ''nix "$@" --system aarch64-freebsd -j0'';
    xnom  = mkArgsAlias ''nom "$@" --system x86_64-linux -j0'';
    xnix  = mkArgsAlias ''nix "$@" --system x86_64-linux -j0'';
    anom  = mkArgsAlias ''nom "$@" --system aarch64-linux -j0'';
    anix  = mkArgsAlias ''nix "$@" --system aarch64-linux -j0'';
    dnom  = mkArgsAlias ''nom "$@" --system x86_64-darwin -j0'';
    dnix  = mkArgsAlias ''nix "$@" --system x86_64-darwin -j0'';
    danom = mkArgsAlias ''nom "$@" --system aarch64-darwin -j0'';
    danix = mkArgsAlias ''nix "$@" --system aarch64-darwin -j0'';

    inom-build  = "nom-build --system i686-linux -j0";
    inix-build  = "nix-build --system i686-linux -j0";
    rnom-build  = "nom-build --system riscv64-linux -j0";
    rnix-build  = "nix-build --system riscv64-linux -j0";
    fnom-build  = "nom-build --system x86_64-freebsd -j0";
    fnix-build  = "nix-build --system x86_64-freebsd -j0";
    fanom-build  = "nom-build --system aarch64-freebsd -j0";
    fanix-build  = "nix-build --system aarch64-freebsd -j0";
    xnom-build  = "nom-build --system x86_64-linux -j0";
    xnix-build  = "nix-build --system x86_64-linux -j0";
    anom-build  = "nom-build --system aarch64-linux -j0";
    anix-build  = "nix-build --system aarch64-linux -j0";
    dnom-build  = "nom-build --system x86_64-darwin -j0";
    dnix-build  = "nix-build --system x86_64-darwin -j0";
    danom-build = "nom-build --system aarch64-darwin -j0";
    danix-build = "nix-build --system aarch64-darwin -j0";
  };
}
