Skip to content

Commit

Permalink
Exclude aliases incompatible with darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
rake5k committed Jun 11, 2024
1 parent baa59b0 commit 4fb3b94
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions home/users/christian/shell/aliases.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{ stdenv, lib }:

{
# Enable aliases with `sudo`
sudo = "sudo ";
Expand All @@ -9,14 +11,6 @@
ps = "ps auxf";
psg = "ps aux | grep -v grep | grep -i -e VSZ -e";

# Safety nets
cp = "cp --interactive=once";
mv = "mv --interactive=once";
rm = "rm --interactive=once --preserve-root=all --one-file-system";
chgrp = "chgrp --preserve-root";
chmod = "chmod --preserve-root";
chown = "chown --preserve-root";

# Navigating
"cd.." = "cd ..";
d = "dirs -v | head -10";
Expand Down Expand Up @@ -55,4 +49,12 @@
# Web
wget = "wget -c";
myip = "curl http://ipecho.net/plain; echo";
} // lib.mkIf (!stdenv.isDarwin) {
# Safety nets
cp = "cp --interactive=once";
mv = "mv --interactive=once";
rm = "rm --interactive=once --preserve-root=all --one-file-system";
chgrp = "chgrp --preserve-root";
chmod = "chmod --preserve-root";
chown = "chown --preserve-root";
}
2 changes: 1 addition & 1 deletion home/users/christian/shell/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ in
MANPAGER = "less -R --use-color -Dd+g -Du+b";
};

shellAliases = import ./aliases.nix;
shellAliases = import ./aliases.nix { inherit lib; inherit (pkgs) stdenv; };
};

programs = {
Expand Down

0 comments on commit 4fb3b94

Please sign in to comment.