ccache: default to 50G cache
This commit is contained in:
parent
97a1b5732b
commit
45f3d5a117
|
@ -1,4 +1,4 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, sane-lib, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf mkOption types;
|
inherit (lib) mkIf mkOption types;
|
||||||
|
@ -19,11 +19,19 @@ in
|
||||||
|
|
||||||
# granular compilation cache
|
# granular compilation cache
|
||||||
# docs: <https://nixos.wiki/wiki/CCache>
|
# 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;
|
programs.ccache.enable = true;
|
||||||
sane.persist.sys.plaintext = [
|
sane.persist.sys.plaintext = [
|
||||||
{ group = "nixbld"; mode = "0775"; directory = config.programs.ccache.cacheDir; }
|
{ 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 ];
|
nix.settings.extra-sandbox-paths = [ config.programs.ccache.cacheDir ];
|
||||||
programs.ccache.packageNames = [
|
programs.ccache.packageNames = [
|
||||||
# these have to exist in toplevel package set:
|
# these have to exist in toplevel package set:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user