system/ccache: init and add to hyacinth
This commit is contained in:
parent
9063ff9dda
commit
d9e7668ff4
4 changed files with 33 additions and 2 deletions
|
|
@ -27,6 +27,7 @@ in {
|
|||
system = mkAttrsFromPaths [
|
||||
./system/audio.nix
|
||||
./system/base.nix
|
||||
./system/ccache.nix
|
||||
./system/greetd.nix
|
||||
./system/gui.nix
|
||||
./system/home-manager.nix
|
||||
|
|
|
|||
30
modules/system/ccache.nix
Normal file
30
modules/system/ccache.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ config, ... }: {
|
||||
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
|
||||
'';
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
package = pkgs.nixUnstable;
|
||||
|
||||
settings = rec {
|
||||
extra-sandbox-paths = [ config.programs.ccache.cacheDir ];
|
||||
substituters = [
|
||||
"https://cache.nixos.org?priority=10"
|
||||
"https://lava.cachix.org"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue