ccache: default to 50G cache

This commit is contained in:
Colin 2023-03-05 03:50:04 +00:00
parent 97a1b5732b
commit 45f3d5a117

View File

@ -1,4 +1,4 @@
{ config, lib, ... }:
{ config, lib, sane-lib, ... }:
let
inherit (lib) mkIf mkOption types;
@ -19,11 +19,19 @@ in
# granular compilation cache
# docs: <https://nixos.wiki/wiki/CCache>
# investigate the cache with `nix-cache --show-stats`
# investigate the cache with:
# - `nix-ccache --show-stats`
# - `build '.#ccache'
# - `sudo CCACHE_DIR=/var/cache/ccache ./result/bin/ccache --show-stats -v`
# TODO: whitelist `--verbose` in <nixpkgs:nixos/modules/programs/ccache.nix>
# TODO: configure without compression (leverage fs-level compression), and enable file-clone (i.e. hardlinks)
programs.ccache.enable = true;
sane.persist.sys.plaintext = [
{ group = "nixbld"; mode = "0775"; directory = config.programs.ccache.cacheDir; }
];
sane.fs."/var/cache/ccache/ccache.conf" = sane-lib.fs.wantedText ''
max_size = 50G
'';
nix.settings.extra-sandbox-paths = [ config.programs.ccache.cacheDir ];
programs.ccache.packageNames = [
# these have to exist in toplevel package set: