commit ea4d875499e55e074424d9088b1e1cd2145e9ee9
parent 4a5c52db2ffe4d9d3ac5ecfe32b4c58b7019625b
Author: Vincent Demeester <vincent@sbr.pm>
Date: Thu, 30 Apr 2020 02:52:09 +0200
Makefile: clean support with root
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
@@ -64,7 +64,12 @@ switch: assets setup
# Cleaning
.PHONY: clean
clean:
- -unlink result
+ @if test $(USER) = root;\
+ then\
+ nix-env --profile /nix/var/nix/profiles/system --delete-generations 15d;\
+ else\
+ unlink result;\
+ fi
.PHONY: clean-www
clean-www: