add ccache
This commit is contained in:
parent
058265c410
commit
9f14173c43
6 changed files with 73 additions and 16 deletions
|
@ -59,6 +59,9 @@ in
|
||||||
distro = "${distroName} ${version} (${codeName}) ${system}";
|
distro = "${distroName} ${version} (${codeName}) ${system}";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nix.settings.extra-sandbox-paths = [ config.programs.ccache.cacheDir ];
|
||||||
|
programs.ccache.enable = true;
|
||||||
|
|
||||||
environment.systemPackages =
|
environment.systemPackages =
|
||||||
with pkgs;
|
with pkgs;
|
||||||
with lib;
|
with lib;
|
||||||
|
|
31
overlays/ccache-wrapper.nix
Normal file
31
overlays/ccache-wrapper.nix
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
final,
|
||||||
|
prev,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
ccacheWrapper = prev.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
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
|
@ -21,5 +21,6 @@
|
||||||
./deskwhich.nix
|
./deskwhich.nix
|
||||||
./mcontrolcenter.nix
|
./mcontrolcenter.nix
|
||||||
./the-powder-toy.nix
|
./the-powder-toy.nix
|
||||||
|
./ccache-wrapper.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
{ final, prev, ... }:
|
{ final, prev, ... }:
|
||||||
{
|
{
|
||||||
matrix-appservice-discord = prev.matrix-appservice-discord.overrideAttrs (old: {
|
matrix-appservice-discord = prev.matrix-appservice-discord.overrideAttrs (old: {
|
||||||
src = prev.fetchFromGitHub {
|
src = prev.fetchFromGitHub {
|
||||||
owner = "t2bot";
|
owner = "t2bot";
|
||||||
repo = "matrix-appservice-discord";
|
repo = "matrix-appservice-discord";
|
||||||
rev = "8361ca6121bf1f0902154baa538cb6d5766e477f";
|
rev = "8361ca6121bf1f0902154baa538cb6d5766e477f";
|
||||||
hash = "sha256-oXon6pFJgqQ1uBLtsSVNH7XSOpxxJYqpW2n9cFrs3sU=";
|
hash = "sha256-oXon6pFJgqQ1uBLtsSVNH7XSOpxxJYqpW2n9cFrs3sU=";
|
||||||
};
|
};
|
||||||
patches =
|
patches =
|
||||||
(
|
(
|
||||||
let
|
let
|
||||||
oldPatches = old.patches or [ ];
|
oldPatches = old.patches or [ ];
|
||||||
in
|
in
|
||||||
if oldPatches == null then [ ] else oldPatches
|
if oldPatches == null then [ ] else oldPatches
|
||||||
)
|
)
|
||||||
++ [ ./patches/bridge_perms.patch ];
|
++ [ ../patches/bridge_perms.patch ];
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
22
patches/lix-ccache.patch
Normal file
22
patches/lix-ccache.patch
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
diff --git a/package.nix b/package.nix
|
||||||
|
index 0186b7472..da783e152 100644
|
||||||
|
--- a/package.nix
|
||||||
|
+++ b/package.nix
|
||||||
|
@@ -1,7 +1,7 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
- stdenv,
|
||||||
|
+ ccacheStdenv,
|
||||||
|
aws-sdk-cpp,
|
||||||
|
# If the patched version of Boehm isn't passed, then patch it based off of
|
||||||
|
# pkgs.boehmgc. This allows `callPackage`ing this file without needing to
|
||||||
|
@@ -81,6 +81,8 @@ let
|
||||||
|
inherit (__forDefaults) canRunInstalled;
|
||||||
|
inherit (lib) fileset;
|
||||||
|
|
||||||
|
+ stdenv = ccacheStdenv;
|
||||||
|
+
|
||||||
|
version = lib.fileContents ./.version + versionSuffix;
|
||||||
|
|
||||||
|
aws-sdk-cpp-nix = aws-sdk-cpp.override {
|
Loading…
Reference in a new issue