| environment.persistence = { |
| "/nix/persist".users.${username}.directories = [ |
| directory = ".cache/ccache"; |
| "/large/persist".directories = [ config.programs.ccache.cacheDir ]; |
| programs.ccache.enable = true; |
| /* nixpkgs.config.replaceStdenv = { pkgs }: pkgs.ccacheStdenv; */ |
| /* nixpkgs.config.allowBroken = true; */ |
| nix.settings.extra-sandbox-paths = [ config.programs.ccache.cacheDir ]; |
| ccacheWrapper = super.ccacheWrapper.override { |
| export CCACHE_DIR="${config.programs.ccache.cacheDir}" |
| if [ ! -d "$CCACHE_DIR" ]; then |
| echo "Directory '$CCACHE_DIR' does not exist" |
| echo "Please create it with:" |
| echo " sudo mkdir -m0770 '$CCACHE_DIR'" |
| echo " sudo chown root:nixbld '$CCACHE_DIR'" |
| if [ ! -w "$CCACHE_DIR" ]; then |
| echo "Directory '$CCACHE_DIR' is not accessible for user $(whoami)" |
| echo "Please verify its access permissions" |