add u, the most awesome program

This commit is contained in:
nora 2025-04-19 12:01:54 +02:00
parent 1235ffe614
commit dd0b4d1f71
5 changed files with 38 additions and 4 deletions

View file

@ -3,6 +3,7 @@ pkgs: {
monaspace = import ./monaspace.nix pkgs; monaspace = import ./monaspace.nix pkgs;
run = import ./run { inherit pkgs; }; run = import ./run { inherit pkgs; };
unpem = import ./unpem { inherit pkgs; }; unpem = import ./unpem { inherit pkgs; };
u = import ./u { inherit pkgs; };
x = import ./x { inherit pkgs; }; x = import ./x { inherit pkgs; };
} }

32
custom-pkgs/u/default.nix Normal file
View file

@ -0,0 +1,32 @@
{ pkgs, ... }: pkgs.writeShellApplication {
name = "u";
text = ''
programs=(cargo git)
if [ -z "''${1:-}" ]; then
echo "u: universial command executor"
echo "programs: ''${programs[*]}"
exit 0
fi
program_to_use=""
for program in "''${programs[@]}"; do
if PAGER=true "$program" "$1" --help >/dev/null 2>/dev/null; then
if [ -n "$program_to_use" ]; then
echo "u: conflict: $1 is provided by both $program_to_use and $program" >&2
exit 1
fi
program_to_use="$program"
fi
done
if [ -n "$program_to_use" ]; then
exec "$program_to_use" "$@"
fi
echo "error: cannot find program for $1" >&2
exit 1
'';
}

View file

@ -29,5 +29,6 @@ with pkgs; [
rustup-toolchain-install-master rustup-toolchain-install-master
samply samply
tokei tokei
customPkgs.u
uwuify uwuify
] ++ crates ] ++ crates

View file

@ -20,6 +20,8 @@
autosq = "autosquash"; autosq = "autosquash";
pfush = "!echo \"hör uf ume z'pfusche und machs richtig\""; pfush = "!echo \"hör uf ume z'pfusche und machs richtig\"";
sw = "!git checkout $(git branch --format \"%(refname:lstrip=2)\" | ${lib.getExe' pkgs.fzf "fzf"})"; sw = "!git checkout $(git branch --format \"%(refname:lstrip=2)\" | ${lib.getExe' pkgs.fzf "fzf"})";
# lol
build = "!cargo build";
}; };
difftastic = { difftastic = {
enable = true; enable = true;

View file

@ -181,10 +181,8 @@ in
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-gnome pkgs.gnome-keyring ]; xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-gnome pkgs.gnome-keyring ];
programs.waybar.enable = true; programs.waybar.enable = true;
# TODO: Create a fancontrol config programs.coolercontrol.enable = true;
hardware.fancontrol.enable = false; programs.coolercontrol.nvidiaSupport = true;
hardware.fancontrol.config = ''
'';
services.flatpak.enable = true; services.flatpak.enable = true;
console.keyMap = "sg"; console.keyMap = "sg";