From a42f15918c3d4e76889f1fb1c5dfcd4b5989d7f3 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 12 May 2018 22:22:56 -0300 Subject: Add scripts/gc.sh --- README.org | 7 ------- scripts/gc.sh | 13 +++++++++++++ 2 files changed, 13 insertions(+), 7 deletions(-) create mode 100755 scripts/gc.sh 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/* -- cgit v1.2.3