mirror of
https://github.com/nmasur/dotfiles
synced 2025-04-24 19:42:24 +00:00
Compare commits
2 Commits
c59e914430
...
5ce9a26441
Author | SHA1 | Date | |
---|---|---|---|
|
5ce9a26441 | ||
|
73680961a0 |
26
modules/common/shell/bash/scripts/docker-cleanup.sh
Executable file
26
modules/common/shell/bash/scripts/docker-cleanup.sh
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Stop all containers
|
||||
if [ "$(docker ps -a -q)" ]; then
|
||||
echo "Stopping docker containers..."
|
||||
docker stop "$(docker ps -a -q)"
|
||||
else
|
||||
echo "No running docker containers."
|
||||
fi
|
||||
|
||||
# Remove all stopped containers
|
||||
if [ "$(docker ps -a -q)" ]; then
|
||||
echo "Removing docker containers..."
|
||||
docker rm "$(docker ps -a -q)"
|
||||
else
|
||||
echo "No stopped docker containers."
|
||||
fi
|
||||
|
||||
# Remove all untagged images
|
||||
if docker images | grep -q "^<none>"; then
|
||||
docker rmi "$(docker images | grep "^<none>" | awk '{print $3}')"
|
||||
else
|
||||
echo "No untagged docker images."
|
||||
fi
|
||||
|
||||
echo "Cleaned up docker."
|
@ -12,8 +12,14 @@
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
shellAliases = {
|
||||
|
||||
# Version of bash which works much better on the terminal
|
||||
bash = "${pkgs.bashInteractive}/bin/bash";
|
||||
ls = "exa";
|
||||
|
||||
# Use exa instead of ls for fancier output
|
||||
ls = "exa --group";
|
||||
|
||||
# Move files to XDG trash on the commandline
|
||||
trash = lib.mkIf pkgs.stdenv.isLinux "${pkgs.trash-cli}/bin/trash-put";
|
||||
};
|
||||
functions = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user