diff --git a/machines/universedesktop/ccache.nix b/machines/universedesktop/ccache.nix new file mode 100644 index 0000000..528c24e --- /dev/null +++ b/machines/universedesktop/ccache.nix @@ -0,0 +1,30 @@ +{ config, pkgs, lib, ... }: { +nixpkgs.overlays = [ + (self: super: { + ccacheWrapper = super.ccacheWrapper.override { + extraConfig = '' + export CCACHE_COMPRESS=1 + export CCACHE_DIR="${config.programs.ccache.cacheDir}" + export CCACHE_UMASK=007 + if [ ! -d "$CCACHE_DIR" ]; then + echo "=====" + 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'" + echo "=====" + exit 1 + fi + if [ ! -w "$CCACHE_DIR" ]; then + echo "=====" + echo "Directory '$CCACHE_DIR' is not accessible for user $(whoami)" + echo "Please verify its access permissions" + echo "=====" + exit 1 + fi + ''; + }; + }) +]; +nix.settings.extra-sandbox-paths = [ config.programs.ccache.cacheDir ]; +} diff --git a/machines/universedesktop/configuration.nix b/machines/universedesktop/configuration.nix index 496ee87..9ca26cb 100644 --- a/machines/universedesktop/configuration.nix +++ b/machines/universedesktop/configuration.nix @@ -24,6 +24,9 @@ ./programs/video.nix ./programs/remote.nix ./printing.nix + + # ccache, y'know for blenders and whatnots + ./ccache.nix ]; fileSystems."/home/universe/tmp" = {