diff --git a/machines/AMD-Workstation/default.nix b/machines/AMD-Workstation/default.nix index 74b4532..c93f3e3 100644 --- a/machines/AMD-Workstation/default.nix +++ b/machines/AMD-Workstation/default.nix @@ -17,7 +17,7 @@ customProfiles.wine-games customProfiles.ollama - ]; + customProfiles.ccache security.pki.certificateFiles = [ ../../misc/mitmproxy-ca-cert.pem ]; diff --git a/profiles/ccache.nix b/profiles/ccache.nix new file mode 100644 index 0000000..2606884 --- /dev/null +++ b/profiles/ccache.nix @@ -0,0 +1,28 @@ +{ config, lib, ... }: { + programs.ccache = { + enable = true; + cacheDir = "/var/lib/ccache"; + # packageNames = [ "grub2" ]; + }; + nix.settings.extra-sandbox-paths = [ config.programs.ccache.cacheDir ]; + + persist.state.directories = lib.mkIf (config.deviceSpecific.devInfo.fileSystem != "zfs") [ + config.programs.ccache.cacheDir + ]; + + nixpkgs.overlays = [ + (final: prev: { + ccacheWrapper = prev.ccacheWrapper.override { + # export CCACHE_SLOPPINESS=random_seed,pch_defines,time_macros,include_file_mtime,include_file_ctime + extraConfig = '' + export CCACHE_NOCOMPRESS=true + export CCACHE_MAXSIZE=15G + export CCACHE_DIR="${config.programs.ccache.cacheDir}" + export CCACHE_UMASK=007 + export CCACHE_SLOPPINESS=random_seed + export CCACHE_BASEDIR=$NIX_BUILD_TOP + ''; + }; + }) + ]; +}