fix(nh): drop the automatic GC timer; keep nh for rebuilds
The scheduled `nh clean` only reclaimed disk and risked reaping store paths the current generation still references (notably on nix-darwin). Keep `programs.nh` (nicer rebuilds + $NH_FLAKE) but remove clean.enable; GC manually (`nh clean all` / `nix-collect-garbage -d`) when nothing important is running. The resetZcompdump activation stays as a safety net for stale completion dumps across rebuilds/manual GC. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -126,15 +126,14 @@
|
|||||||
programs.nix-index.enable = true;
|
programs.nix-index.enable = true;
|
||||||
programs.nix-index-database.comma.enable = true;
|
programs.nix-index-database.comma.enable = true;
|
||||||
|
|
||||||
# Nicer nixos-rebuild/home-manager (diffs) + a weekly user-GC timer.
|
# Nicer nixos-rebuild/home-manager (diffs) + $NH_FLAKE. No automatic clean:
|
||||||
|
# the scheduled GC's only benefit is reclaiming disk, but it can reap store
|
||||||
|
# paths the current generation still references (notably on nix-darwin, where
|
||||||
|
# it broke completion by removing an in-use oh-my-zsh). GC manually instead:
|
||||||
|
# `nh clean all` / `nix-collect-garbage -d` when nothing important is running.
|
||||||
programs.nh = {
|
programs.nh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
flake = "$HOME/code/nixfiles";
|
flake = "$HOME/code/nixfiles";
|
||||||
clean = {
|
|
||||||
enable = true;
|
|
||||||
dates = "weekly";
|
|
||||||
extraArgs = "--keep 5 --keep-since 3d";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.tmux = {
|
programs.tmux = {
|
||||||
@@ -260,10 +259,10 @@
|
|||||||
services.ssh-agent.enable = lib.mkIf pkgs.stdenv.hostPlatform.isLinux true;
|
services.ssh-agent.enable = lib.mkIf pkgs.stdenv.hostPlatform.isLinux true;
|
||||||
|
|
||||||
# Drop the zsh completion dump on every activation. A stale ~/.zcompdump
|
# Drop the zsh completion dump on every activation. A stale ~/.zcompdump
|
||||||
# caches /nix/store paths to completion functions; once a rebuild or GC (the
|
# caches /nix/store paths to completion functions; once a rebuild or a manual
|
||||||
# weekly nh clean) removes them, compinit fails with "_git: function
|
# GC removes them, compinit fails with "_git: function definition file not
|
||||||
# definition file not found" for every completion. Deleting it forces a fresh
|
# found" for every completion. Deleting it forces a fresh rebuild from the
|
||||||
# rebuild from the current fpath on the next shell.
|
# current fpath on the next shell.
|
||||||
home.activation.resetZcompdump = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
home.activation.resetZcompdump = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
$DRY_RUN_CMD rm -f "$HOME"/.zcompdump* "''${XDG_CACHE_HOME:-$HOME/.cache}"/zsh/.zcompdump* 2>/dev/null || true
|
$DRY_RUN_CMD rm -f "$HOME"/.zcompdump* "''${XDG_CACHE_HOME:-$HOME/.cache}"/zsh/.zcompdump* 2>/dev/null || true
|
||||||
'';
|
'';
|
||||||
|
|||||||
Reference in New Issue
Block a user