Skip to content

Commit

Permalink
fix: move from auto-optimise-store to nix.optimise
Browse files Browse the repository at this point in the history
auto-optimise-store is known to cause store corruption
on darwin. optimise is a separate incarnation does that not have
these issues.
  • Loading branch information
NoRePercussions committed Nov 13, 2024
1 parent 1e8abff commit cd3d37b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
7 changes: 6 additions & 1 deletion hosts/common/core/nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
{
nix = {
settings = {
auto-optimise-store = true;
experimental-features = ["nix-command" "flakes"];
warn-dirty = false;

Expand All @@ -23,6 +22,12 @@
];
};

optimise.automatic = true;
# optimise every Monday morning
# customized in hosts/common/darwin/nix.nix
# and hosts/common/nixos/nix.nix


gc = {
automatic = true;

Expand Down
6 changes: 6 additions & 0 deletions hosts/common/darwin/nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
nix.settings.extra-platforms = ["x86_64-darwin" "aarch64-darwin"];
services.nix-daemon.enable = true;

nix.optimise.interval = [{
Hour = 4;
Minute = 15;
Weekday = 1;
}];

nix.gc.interval = [{
Hour = 3;
Minute = 15;
Expand Down
1 change: 1 addition & 0 deletions hosts/common/nixos/nix.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ ... }:
{
nix.optimise.dates = [ "Mon *-*-* 04:15:00" ];
nix.gc.dates = "Mon *-*-* 03:15:00";
}

0 comments on commit cd3d37b

Please sign in to comment.