From 44f757f535e114d923f6d877a168e607af4832d2 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Tue, 10 Dec 2024 23:58:47 +0000 Subject: [PATCH] feat(cachix): add cachix configuration files and update host.nix - Added `cachix.nix` for configuring Cachix substituters - Added `cachix/nix-community.nix` for Nix Community Cachix settings - Updated `lib/host.nix` to include `pkgs.nixosModules.cachixConfig` in the list of NixOS modules --- cachix.nix | 13 +++++++++++++ cachix/nix-community.nix | 13 +++++++++++++ lib/host.nix | 1 + 3 files changed, 27 insertions(+) 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..ecd2d39 --- /dev/null +++ b/cachix.nix @@ -0,0 +1,13 @@ + +# 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.settings.substituters = ["https://cache.nixos.org/"]; +} diff --git a/cachix/nix-community.nix b/cachix/nix-community.nix new file mode 100644 index 0000000..7fc4c65 --- /dev/null +++ b/cachix/nix-community.nix @@ -0,0 +1,13 @@ + +{ + nix = { + settings = { + substituters = [ + "https://nix-community.cachix.org" + ]; + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; + }; +} diff --git a/lib/host.nix b/lib/host.nix index 1a51b5b..2aaebfd 100644 --- a/lib/host.nix +++ b/lib/host.nix @@ -42,6 +42,7 @@ home-manager.nixosModules.home-manager ../hosts/${name}/default.nix + pkgs.nixosModules.cachixConfig ]; }; }