Files
NixMachines/machines/ptv/ccache.nix

43 lines
1.4 KiB
Nix

{ config, pkgs, lib, inputs, ... }: {
programs.ccache.enable = true;
programs.ccache.cacheDir = "/opt/ccache";
nix.settings.extra-sandbox-paths = [ "/opt/ccache" ];
nixpkgs.overlays = [
(self: super: {
ccacheWrapper = super.ccacheWrapper.override {
# TODO: Sloppiness random_seed apart of wrapper
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
'';
};
linux-ptv-ccache = pkgs.callPackage "${inputs.nixos-hardware}/pine64/pinetab-v/linux-5.15.nix" {
argsOverride = {
stdenv = self.ccacheStdenv;
};
};
})
];
programs.ccache.packageNames = [ "ffmpeg" "firefox-unwrapped" "tmux" ];
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux-ptv-ccache;
}