Commit 646e80739c90

Vincent Demeester <vincent@sbr.pm>
2018-12-21 16:25:50
nix-config: make local caches a config…
… so that we can disable them in remote machines. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent dca78b9
Changed files (3)
machine/carthage.nix
@@ -5,6 +5,7 @@ with import ../assets/machines.nix; {
     ../networking.nix # generated at runtime by nixos-infect
   ];
   time.timeZone = "Europe/Paris";
+  profiles.nix-config.localCaches = [];
   boot = {
     cleanTmpDir = true;
     loader.grub.enable = true;
machine/kerkouane.nix
@@ -3,6 +3,7 @@
 with import ../assets/machines.nix; {
   imports = [ ../networking.nix ];
   time.timeZone = "Europe/Paris";
+  profiles.nix-config.localCaches = [];
   boot = {
     cleanTmpDir = true;
     loader.grub.enable = true;
modules/profiles/nix-config.nix
@@ -22,6 +22,11 @@ in
         description = "Number of day to keep when garbage collect";
         type = types.str;
       };
+      localCaches = mkOption {
+        default = [ "http://nix.cache.home" ];
+        description = "List of local nix caches";
+        type = types.listOf types.str;
+      };
     };
   };
   config = mkIf cfg.enable {
@@ -37,8 +42,7 @@ in
         connect-timeout = 20
         build-cores = 0
       '';
-      binaryCaches = [
-        "http://nix.cache.home"
+      binaryCaches = cfg.localCaches ++ [
         "https://cache.nixos.org/"
         "https://r-ryantm.cachix.org"
         "https://vdemeester.cachix.org"