From 5db8f66792fd9a0d73eda57b188dd0e0074281b9 Mon Sep 17 00:00:00 2001 From: Mel Date: Fri, 14 Feb 2025 01:39:50 +0100 Subject: Add renard as cache for the rest of the network Signed-off-by: Mel --- modules/nix.nix | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'modules/nix.nix') diff --git a/modules/nix.nix b/modules/nix.nix index 2e067aa..032a092 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -1,5 +1,13 @@ -{ self, ... }: +{ self, me, lib, ... }: +let + inherit (lib) mkIf mkMerge; + + renardCache = { + substituters = [ "https://cache.rnrd.eu" ]; + trusted-public-keys = [ "cache.rnrd.eu-1:6Q2MPTZ6ycAzWcc0VzXR+pKRlJ+6kfdQfj6iRsN5s1I=" ]; + }; +in { nix = { optimise = { @@ -20,9 +28,12 @@ "nixos-config=${self}/compat/nixos" ]; - settings = { - experimental-features = [ "flakes" "nix-command" ]; - trusted-users = [ "root" "mel" ]; - }; + settings = mkMerge [ + { + experimental-features = [ "flakes" "nix-command" ]; + trusted-users = [ "root" "mel" ]; + } + (mkIf (!me.is.renard) renardCache) + ]; }; } -- cgit 1.4.1