From 4551a59f04bd3dba4e2d00449389b15040fdd54d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 27 Aug 2019 15:02:12 +0200 Subject: nix: install cachix --- .gitignore | 1 + cachix.nix | 14 ++++++++++++++ modules/configuration/nix.nix | 4 ++++ 3 files changed, 19 insertions(+) create mode 100644 cachix.nix diff --git a/.gitignore b/.gitignore index 8a1263b..1ba8e95 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /hardware-configuration.nix /configuration.nix /darwin-configuration.nix +/cachix 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/modules/configuration/nix.nix b/modules/configuration/nix.nix index 54361d9..15cbb7a 100644 --- a/modules/configuration/nix.nix +++ b/modules/configuration/nix.nix @@ -21,6 +21,10 @@ }; }; + environment.systemPackages = with pkgs; [ + cachix + ]; + system.autoUpgrade = { enable = true; flags = [ "--max-jobs" "2" ]; -- cgit 1.4.1