diff --git a/hosts/hyacinth/default.nix b/hosts/hyacinth/default.nix index 4fe6c33..d4aa308 100644 --- a/hosts/hyacinth/default.nix +++ b/hosts/hyacinth/default.nix @@ -16,6 +16,7 @@ audio base + ccache greetd gui input @@ -47,7 +48,6 @@ }; virtualisation = { lxd.enable = true; - #waydroid.enable = true; spiceUSBRedirection.enable = true; libvirtd = { enable = true; @@ -66,5 +66,4 @@ "python-2.7.18.6-env" "python-2.7.18.6" ]; - } diff --git a/modules/default.nix b/modules/default.nix index 205afc2..bba3698 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -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 diff --git a/modules/system/ccache.nix b/modules/system/ccache.nix new file mode 100644 index 0000000..814c857 --- /dev/null +++ b/modules/system/ccache.nix @@ -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 + ''; + }; + }) + ]; +} diff --git a/modules/system/nix.nix b/modules/system/nix.nix index 3152bb9..dc16ed4 100644 --- a/modules/system/nix.nix +++ b/modules/system/nix.nix @@ -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"