aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2018-05-12 22:22:56 -0300
committerEuAndreh <eu@euandre.org>2018-05-12 22:22:56 -0300
commita42f15918c3d4e76889f1fb1c5dfcd4b5989d7f3 (patch)
treef988189b0b20451db998871dcf64ac6976352242
parentAdd repos to mrconfig (diff)
downloaddotfiles-a42f15918c3d4e76889f1fb1c5dfcd4b5989d7f3.tar.gz
dotfiles-a42f15918c3d4e76889f1fb1c5dfcd4b5989d7f3.tar.xz
Add scripts/gc.sh
-rw-r--r--README.org7
-rwxr-xr-xscripts/gc.sh13
2 files changed, 13 insertions, 7 deletions
diff --git a/README.org b/README.org
index 7b33c8b..081b492 100644
--- a/README.org
+++ b/README.org
@@ -1,11 +1,4 @@
* dotfiles
-**
-** NixOS
-*** Cleaning up the store
-#+BEGIN_SRC shell
-$ sudo nix-env -p /nix/var/nix/profiles/per-user/root/channels --delete-generations old
-$ sudo nix-env -p /nix/var/nix/profiles/system --delete-generations old
-#+END_SRC
** Instructions - setting up a new installation (NixOS)
*** 1. Download NixOS image from [[https://nixos.org/][the website]].
*** 2. Follow USB ISO installation steps in =nixos/os-installation.sh=
diff --git a/scripts/gc.sh b/scripts/gc.sh
new file mode 100755
index 0000000..84717fb
--- /dev/null
+++ b/scripts/gc.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+# Cleaning up the NixOS store
+
+profiles=(per-user/root/channels per-user/andreh/profile per-user/andreh/channels system)
+
+for p in ${profiles[@]}; do
+ sudo nix-env --delete-generations old -p /nix/var/nix/profiles/$p
+done
+
+nix-collect-garbage -d
+
+rm -rf ~/.local/share/Trash/files/*