summaryrefslogtreecommitdiffstats
path: root/systems/qi/base.nix
diff options
context:
space:
mode:
Diffstat (limited to 'systems/qi/base.nix')
-rw-r--r--systems/qi/base.nix32
1 files changed, 26 insertions, 6 deletions
diff --git a/systems/qi/base.nix b/systems/qi/base.nix
index 73f17b4c..cc4377c0 100644
--- a/systems/qi/base.nix
+++ b/systems/qi/base.nix
@@ -11,16 +11,36 @@
krebs.shadow.overridesFile =
"${config.krebs.secret.directory}/shadow-overrides";
- # Cross-compiled where the builder's system differs.
- mobile.boot.stage-1.kernel.package = lib.mkForce (
- (import pkgs.path {
+ # Cross-compiled where the builder's system differs, with ccache where the
+ # builder has /var/cache/ccache in its sandbox.
+ mobile.boot.stage-1.kernel.package = lib.mkForce (let
+ buildPkgs = import pkgs.path {
localSystem = buildSystem;
crossSystem = pkgs.stdenv.hostPlatform.system;
inherit (pkgs) config overlays;
- }).callPackage
+ };
+ stdenv = buildPkgs.ccacheStdenv.override {
+ extraConfig = /* sh */ ''
+ if [ -w /var/cache/ccache ]; then
+ export CCACHE_COMPRESS=1
+ export CCACHE_DIR=/var/cache/ccache
+ export CCACHE_SLOPPINESS=random_seed
+ export CCACHE_UMASK=007
+ else
+ export CCACHE_DIR=''${TMPDIR:-/tmp}/ccache
+ export CCACHE_DISABLE=1
+ fi
+ '';
+ };
+ in
+ buildPkgs.callPackage
(inputs.mobile-nixos + "/devices/families/sdm845-mainline/kernel")
- { }
- );
+ {
+ mobile-nixos = buildPkgs.mobile-nixos // {
+ kernel-builder =
+ buildPkgs.mobile-nixos.kernel-builder.override { inherit stdenv; };
+ };
+ });
# The kernel has no modules.
boot.kernelModules = lib.mkForce [ ];