feat: update - reduce disk usage

This commit is contained in:
Ryan Yin 2023-06-23 23:54:50 +08:00
parent 86ab7528ff
commit 192df99403
2 changed files with 10 additions and 8 deletions

View File

@ -69,6 +69,7 @@ nix-env -qa
## Reduce Disk Usage
The following configuration can be used to reduce disk usage, feel free to add it into your NixOS Configuration.
```nix
{ lib, pkgs, ... }:
@ -77,14 +78,14 @@ nix-env -qa
# ......
# do not need to keep too much generations
boot.loader.systemd-boot.configurationLimit = lib.mkDefault 10;
boot.loader.systemd-boot.configurationLimit = 10;
# boot.loader.grub.configurationLimit = 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 1w";
automatic = true;
dates = "weekly";
options = "--delete-older-than 1w";
};
# Optimise storage

View File

@ -65,6 +65,7 @@ nix-env -qa
## 节约存储空间
如下配置可以比较好的缩减 NixOS 的磁盘占用,可以考虑将它们添加到你的 NixOS 配置中:
```nix
{ lib, pkgs, ... }:
@ -73,14 +74,14 @@ nix-env -qa
# ......
# do not need to keep too much generations
boot.loader.systemd-boot.configurationLimit = lib.mkDefault 10;
boot.loader.systemd-boot.configurationLimit = 10;
# boot.loader.grub.configurationLimit = 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 1w";
automatic = true;
dates = "weekly";
options = "--delete-older-than 1w";
};
# Optimise storage