mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-03-29 22:01:58 +02:00
feat: nix.gc.automatic = true
This commit is contained in:
@@ -1,11 +1,9 @@
|
|||||||
{
|
{
|
||||||
description = "NixOS configuration of Ryan Yin";
|
description = "NixOS configuration of Ryan Yin";
|
||||||
|
|
||||||
|
# the nixConfig here only affects the flake itself, not the system configuration!
|
||||||
nixConfig = {
|
nixConfig = {
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
# Manual optimise storage: nix-store --optimise
|
|
||||||
# https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-auto-optimise-store
|
|
||||||
auto-optimise-store = true;
|
|
||||||
|
|
||||||
substituters = [
|
substituters = [
|
||||||
# replace official cache with a mirror located in China
|
# replace official cache with a mirror located in China
|
||||||
|
|||||||
@@ -1,6 +1,20 @@
|
|||||||
{ config, pkgs, devenv, ... }:
|
{ config, pkgs, devenv, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
# for nix server, we do not need to keep too much generations
|
||||||
|
boot.loader.systemd-boot.configurationLimit = 10;
|
||||||
|
# boot.loader.grub.configurationLimit = 10;
|
||||||
|
# do garbage collection weekly to keep disk usage low
|
||||||
|
nix.gc = {
|
||||||
|
automatic = true;
|
||||||
|
dates = "weekly";
|
||||||
|
options = "--delete-older-than 1w";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Manual optimise storage: nix-store --optimise
|
||||||
|
# https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-auto-optimise-store
|
||||||
|
auto-optimise-store = true;
|
||||||
|
|
||||||
# enable flakes globally
|
# enable flakes globally
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,20 @@
|
|||||||
{ config, pkgs, devenv, ... }:
|
{ config, pkgs, devenv, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
# for nix server, we do not need to keep too much generations
|
||||||
|
boot.loader.systemd-boot.configurationLimit = 10;
|
||||||
|
# boot.loader.grub.configurationLimit = 10;
|
||||||
|
# do garbage collection weekly to keep disk usage low
|
||||||
|
nix.gc = {
|
||||||
|
automatic = true;
|
||||||
|
dates = "weekly";
|
||||||
|
options = "--delete-older-than 1w";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Manual optimise storage: nix-store --optimise
|
||||||
|
# https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-auto-optimise-store
|
||||||
|
auto-optimise-store = true;
|
||||||
|
|
||||||
# enable flakes globally
|
# enable flakes globally
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user