System : Enabme GC for 7 days.

This commit is contained in:
Dmitry Voronin 2024-03-03 21:15:25 +03:00
parent 96aa149cb3
commit 025f711262
3 changed files with 6 additions and 7 deletions

View file

@ -1,6 +1,9 @@
{ environment, ... }: { { environment, ... }: {
environment.variables.NIXPKGS_ALLOW_UNFREE = "1"; environment.variables.NIXPKGS_ALLOW_UNFREE = "1";
nix.extraOptions = "experimental-features = nix-command flakes";
nix.gc.automatic = true;
nix.gc.dates = "daily";
nix.gc.options = "--delete-older-than 7d";
nix.settings.auto-optimise-store = true; nix.settings.auto-optimise-store = true;
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nix.extraOptions = "experimental-features = nix-command flakes";
} }

View file

@ -33,11 +33,8 @@ function nix_shell() {
local target="${1}" local target="${1}"
[[ "${target}" = "" ]] && target="default" [[ "${target}" = "" ]] && target="default"
if [[ "${target}" = "default" ]]; then nix build ".#devShells.${target}" -o ".NixRoot"
NIX_SHELL="${target}" nix develop NIX_SHELL="${target}" nix develop ".#devShells.${target}"
else
NIX_SHELL="${target}" nix develop ".#${target}"
fi
} }
alias shell="nix_shell" alias shell="nix_shell"

View file

@ -8,7 +8,6 @@ function prune_docker() {
# Prune Nix Store. # Prune Nix Store.
function prune_nix() { function prune_nix() {
nix-collect-garbage -d nix-collect-garbage -d
_is_root && nix-store --gc
} }
# Uninstall flatpaks not listed in the config. # Uninstall flatpaks not listed in the config.