summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinnnus <[email protected]>2024-11-16 13:00:36 +0100
committerLinnnus <[email protected]>2024-11-16 13:00:36 +0100
commit18336d643163a6b339f6198c7f53b109ee58bdf7 (patch)
treeb986b6ee6e51a4d01d110b0f82ae08460bc37a06
parent1c3e554e7f77a6d2a2374ef4fe32bf0d287dfd40 (diff)
home: Add stat wrapper for OSX
-rw-r--r--home/shell-utils/default.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/home/shell-utils/default.nix b/home/shell-utils/default.nix
index 0207d40..c3ea75e 100644
--- a/home/shell-utils/default.nix
+++ b/home/shell-utils/default.nix
@@ -17,5 +17,16 @@ in {
pbv
trash
disable-sleep
+
+ # Unlike the `stat` command on Linux (from coreutils or whatever), OSX's
+ # `stat` does not automatically use the nicer format when stdout is a
+ # sterminal.
+ (pkgs.writeShellScriptBin "stat" ''
+ if [ -t 1 ]; then
+ /usr/bin/stat -x "$@"
+ else
+ /usr/bin/stat "$@"
+ fi
+ '')
];
}