fix: agenix on nix-darwin, update flake.nix

This commit is contained in:
Ryan Yin
2023-12-18 12:59:41 +08:00
parent 8d83ded0fb
commit dbe62811c7
17 changed files with 90 additions and 113 deletions

View File

@@ -29,25 +29,6 @@
builders-use-substitutes = true;
};
# do garbage collection weekly to keep disk usage low
nix.gc =
{
automatic = lib.mkDefault true;
options = lib.mkDefault "--delete-older-than 7d";
}
// (
if pkgs.stdenv.isLinux
then {
dates = lib.mkDefault "weekly";
}
else {
# nix-darwin
interval = {
Hour = 24;
};
}
);
# Allow unfree packages
nixpkgs.config.allowUnfree = lib.mkDefault false;
}

View File

@@ -1,6 +1,5 @@
{
pkgs,
lib,
...
}: {
###################################################################################
@@ -27,7 +26,7 @@
# Disable auto-optimise-store because of this issue:
# https://github.com/NixOS/nix/issues/7273
# "error: cannot link '/nix/store/.tmp-link-xxxxx-xxxxx' to '/nix/store/.links/xxxx': File exists"
nix.settings = {
auto-optimise-store = false;
};
nix.settings.auto-optimise-store = false;
nix.gc.automatic = false;
}

View File

@@ -15,6 +15,13 @@
# for nix server, we do not need to keep too much generations
boot.loader.systemd-boot.configurationLimit = lib.mkDefault 10;
# do garbage collection weekly to keep disk usage low
nix.gc = {
automatic = lib.mkDefault true;
dates = lib.mkDefault "weekly";
options = lib.mkDefault "--delete-older-than 7d";
};
# Manual optimise storage: nix-store --optimise
# https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-auto-optimise-store
nix.settings.auto-optimise-store = true;