mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
feat: add NixOS auto-GC and -store optimisation
This commit is contained in:
parent
88f64a3139
commit
af3224a1d5
2 changed files with 39 additions and 0 deletions
|
|
@ -4660,6 +4660,33 @@ Needed for control over system-wide privileges etc.
|
|||
|
||||
#+end_src
|
||||
|
||||
**** Enable automatic garbage collection
|
||||
|
||||
The nix store fills up over time, until =/boot/efi= is filled. This snippet cleans it automatically on a weekly basis.
|
||||
|
||||
#+begin_src nix :tangle profiles/common/nixos.nix
|
||||
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
randomizedDelaySec = "14m";
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 10d";
|
||||
};
|
||||
|
||||
#+end_src
|
||||
|
||||
**** Enable automatic store optimisation
|
||||
|
||||
This enables hardlinking identical files in the nix store, to save on disk space. I have read this incurs a significant I/O overhead, I need to keep an eye on this.
|
||||
|
||||
#+begin_src nix :tangle profiles/common/nixos.nix
|
||||
|
||||
nix.optimise = {
|
||||
automatic = true;
|
||||
dates = [ "weekly" ];
|
||||
};
|
||||
|
||||
#+end_src
|
||||
|
||||
**** Reduce systemd timeouts
|
||||
:PROPERTIES:
|
||||
|
|
|
|||
|
|
@ -32,6 +32,18 @@ stylix.targets.grub.enable = false; # the styling makes grub more ugly
|
|||
|
||||
security.polkit.enable = true;
|
||||
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
randomizedDelaySec = "14m";
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 10d";
|
||||
};
|
||||
|
||||
nix.optimise = {
|
||||
automatic = true;
|
||||
dates = [ "weekly" ];
|
||||
};
|
||||
|
||||
# systemd
|
||||
systemd.extraConfig = ''
|
||||
DefaultTimeoutStartSec=60s
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue