From 7f5dd75732f37a8e12fdb3be4027a50202b2dacd Mon Sep 17 00:00:00 2001 From: Jez Cope Date: Sun, 11 Apr 2021 20:59:43 +0100 Subject: [PATCH] system: Enable cachix for nix-community --- cachix.nix | 14 ++++++++++++++ cachix/nix-community.nix | 12 ++++++++++++ configuration.nix | 10 ++++++++-- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 cachix.nix create mode 100644 cachix/nix-community.nix diff --git a/cachix.nix b/cachix.nix new file mode 100644 index 0000000..cce90a3 --- /dev/null +++ b/cachix.nix @@ -0,0 +1,14 @@ + +# WARN: this file will get overwritten by $ cachix use +{ pkgs, lib, ... }: + +let + folder = ./cachix; + toImport = name: value: folder + ("/" + name); + filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key; + imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); +in { + inherit imports; + nix.binaryCaches = ["https://cache.nixos.org/"]; +} + \ No newline at end of file diff --git a/cachix/nix-community.nix b/cachix/nix-community.nix new file mode 100644 index 0000000..885d38b --- /dev/null +++ b/cachix/nix-community.nix @@ -0,0 +1,12 @@ + +{ + nix = { + binaryCaches = [ + "https://nix-community.cachix.org" + ]; + binaryCachePublicKeys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; +} + \ No newline at end of file diff --git a/configuration.nix b/configuration.nix index 3d5ba36..b003f07 100644 --- a/configuration.nix +++ b/configuration.nix @@ -10,8 +10,12 @@ let host-config = ./machines + "/${hostName}.nix"; optionalPath = path: lib.lists.optional (builtins.pathExists path) path; in { - imports = [ ./hardware-configuration.nix ./local.nix ] - ++ optionalPath host-config; + imports = [ + + ./hardware-configuration.nix + ./local.nix + ./cachix.nix + ] ++ optionalPath host-config; # Nix ###################################################################### system.stateVersion = "20.03"; # Leave this alone (see configuration.nix(5)) @@ -119,6 +123,8 @@ in { # General ################################################################## environment.systemPackages = with pkgs; [ + cachix + wget vim git