From 5526ce4b19d1dd5bee09f1d274bc88260853485c Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 10 Apr 2024 18:13:45 -0400 Subject: Use ccache in builds Add ccache support to the OsBase definition, so it's automatically setup for all machines. Hopefully this can speed up builds and at least prevent the worst case performance. Unfortunately, if I modify the stdenv of any upstream targets, the cache is invalidated and I have to rebuild the whole package. In particular webkitgtk is a pain to build, and it has crashed my machine a number of times. I was able to build it once, after enabling zram, which should be enabled anyway like why not? - https://nixos.wiki/wiki/CCache - https://github.com/NixOS/nixpkgs/issues/195522#issuecomment-2043999608 - https://github.com/NixOS/nixpkgs/pull/216363#issuecomment-2043998790 --- Biz/OsBase.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Biz/OsBase.nix') diff --git a/Biz/OsBase.nix b/Biz/OsBase.nix index 50899d2..a9407ab 100644 --- a/Biz/OsBase.nix +++ b/Biz/OsBase.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: let ports = import ./Cloud/Ports.nix; in { boot.tmp.cleanOnBoot = true; @@ -19,6 +19,8 @@ in { nix.gc.dates = "Sunday 02:15"; nix.optimise.automatic = true; nix.optimise.dates = [ "Sunday 02:30" ]; + nix.settings.extra-sandbox-paths = [ config.programs.ccache.cacheDir ]; + programs.ccache.enable = true; programs.mosh.enable = true; programs.mosh.withUtempter = true; security.acme.defaults.email = "ben@bsima.me"; @@ -34,4 +36,5 @@ in { services.openssh.settings.PasswordAuthentication = false; services.openssh.settings.PermitRootLogin = "prohibit-password"; system.autoUpgrade.enable = false; # 'true' breaks our nixpkgs pin + zramSwap.enable = true; } -- cgit v1.2.3