tree-wide: format with nixfmt

Another saturday another useless formatter change.
It's my dotfiles, after all

alejandra doesn't handle c-style inline comments well.
This commit is contained in:
Primrose 2025-11-08 10:15:58 +08:00
parent ec704b5272
commit ebf8468807
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
116 changed files with 1895 additions and 1689 deletions

View file

@ -2,49 +2,51 @@
pkgs,
lib,
...
}: {
programs.cmus.extraConfig = let
# dispatch to multiple callbacks
callback-script = pkgs.writeShellApplication {
name = "cmus-callback-script";
runtimeInputs = [
pkgs.cmusfm
pkgs.libnotify
];
text = ''
# All keys contain only chars a-z. Values are UTF-8 strings.
#
# Keys: status file url artist album discnumber tracknumber title date
# - status (stopped, playing, paused) is always given
# - file or url is given only if track is 'loaded' in cmus
# - other keys/values are given only if they are available
}:
{
programs.cmus.extraConfig =
let
# dispatch to multiple callbacks
callback-script = pkgs.writeShellApplication {
name = "cmus-callback-script";
runtimeInputs = [
pkgs.cmusfm
pkgs.libnotify
];
text = ''
# All keys contain only chars a-z. Values are UTF-8 strings.
#
# Keys: status file url artist album discnumber tracknumber title date
# - status (stopped, playing, paused) is always given
# - file or url is given only if track is 'loaded' in cmus
# - other keys/values are given only if they are available
# Use a map so that we can redirect all the args to cmusfm
argv=("$@")
declare -A map
while [ $# -gt 0 ]; do
map["$1"]="$2"
shift
shift
done
# Use a map so that we can redirect all the args to cmusfm
argv=("$@")
declare -A map
while [ $# -gt 0 ]; do
map["$1"]="$2"
shift
shift
done
# Setup pretty symbols
case ''${map[status]} in
paused)
SYMB=""
;;
playing)
SYMB=""
;;
esac
# Setup pretty symbols
case ''${map[status]} in
paused)
SYMB=""
;;
playing)
SYMB=""
;;
esac
notify-send \
"$SYMB ''${map[title]}" \
"''${map[artist]} / ''${map[album]}"
cmusfm "''${argv[@]}"
'';
};
in
notify-send \
"$SYMB ''${map[title]}" \
"''${map[artist]} / ''${map[album]}"
cmusfm "''${argv[@]}"
'';
};
in
builtins.readFile ./rc
+ lib.optionalString pkgs.stdenv.isLinux ''
set status_display_program=${lib.getExe callback-script}