adding modularity
This commit is contained in:
22
utils/binary-cache.nix
Normal file
22
utils/binary-cache.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
|
||||
# ...
|
||||
nix.settings = {
|
||||
# allow substituters to be used
|
||||
|
||||
substituters = [
|
||||
# also add mirrors?
|
||||
# "https://mirrors.ustc.edu.cn/nix-channels/store"
|
||||
"https://cache.nixos.org"
|
||||
];
|
||||
|
||||
trusted-public-keys = [
|
||||
# the default public key of cache.nixos.org, it's built-in, no need to add it here
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
];
|
||||
};
|
||||
|
||||
}
|
23
utils/garbage-collection.nix
Normal file
23
utils/garbage-collection.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{ lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
# ...
|
||||
|
||||
# Limit the number of generations to keep
|
||||
boot.loader.systemd-boot.configurationLimit = 10;
|
||||
# boot.loader.grub.configurationLimit = 10;
|
||||
|
||||
# Perform garbage collection weekly to maintain low disk usage
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 1w";
|
||||
};
|
||||
|
||||
# Optimize storage
|
||||
# You can also manually optimize the store via:
|
||||
# nix-store --optimise
|
||||
# Refer to the following link for more details:
|
||||
# https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-auto-optimise-store
|
||||
nix.settings.auto-optimise-store = true;
|
||||
}
|
Reference in New Issue
Block a user