system/ccache: fix extraConfig

This commit is contained in:
LavaDesu 2023-08-25 00:39:13 +07:00
parent e7509cfa4b
commit ac900ac7eb
Signed by: cilly
GPG key ID: 6500251E087653C9
3 changed files with 26 additions and 27 deletions

View file

@ -1,30 +1,3 @@
{ config, ... }: { { config, ... }: {
programs.ccache.enable = true; programs.ccache.enable = true;
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
'';
};
})
];
} }

25
overlays/ccache.nix Normal file
View file

@ -0,0 +1,25 @@
self: super: {
ccacheWrapper = super.ccacheWrapper.override {
extraConfig = ''
export CCACHE_COMPRESS=1
export CCACHE_DIR="/var/cache/ccache"
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
'';
};
}

View file

@ -1,5 +1,6 @@
builtins.map (path: import path) [ builtins.map (path: import path) [
./android-studio.nix ./android-studio.nix
./ccache.nix
./discord.nix ./discord.nix
./eww.nix ./eww.nix
./material-icons.nix ./material-icons.nix