From 951ff804a61b8271eef095a0159447645b158822 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Mon, 18 Apr 2022 07:42:44 +0200
Subject: [PATCH] export binary caches via flake

---
 flake.nix    | 9 +++++++++
 nix/nix.conf | 2 --
 shell.nix    | 1 -
 3 files changed, 9 insertions(+), 3 deletions(-)
 delete mode 100644 nix/nix.conf

diff --git a/flake.nix b/flake.nix
index bd4e0af..a9cb22e 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,6 +1,15 @@
 {
   description = "NixOS configuration of our builders";
 
+  nixConfig.extra-substituters = [
+    "https://nix-community.cachix.org"
+    "https://nixpkgs-update.cachix.org"
+  ];
+  nixConfig.extra-trusted-public-keys = [
+    "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
+    "nixpkgs-update.cachix.org-1:6y6Z2JdoL3APdu6/+Iy8eZX2ajf09e4EE9SnxSML1W8="
+  ];
+
   inputs = {
     #nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
     # https://github.com/NixOS/nixpkgs/pull/168186
diff --git a/nix/nix.conf b/nix/nix.conf
deleted file mode 100644
index c359816..0000000
--- a/nix/nix.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-substituters = https://cache.nixos.org https://nix-community.cachix.org/ https://nixpkgs-update.cachix.org/
-trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= nixpkgs-update.cachix.org-1:6y6Z2JdoL3APdu6/+Iy8eZX2ajf09e4EE9SnxSML1W8=
diff --git a/shell.nix b/shell.nix
index bb1c73c..c1ef7de 100644
--- a/shell.nix
+++ b/shell.nix
@@ -31,6 +31,5 @@ mkShell {
 
   shellHook = ''
     export CLOUDFLARE_API_TOKEN=$(< ./secrets/cloudflare-api-token)
-    export NIX_USER_CONF_FILES="$(pwd)/nix/nix.conf";
   '';
 }