From 2c2987e35f22c176770687911a91aa45fd645725 Mon Sep 17 00:00:00 2001 From: atagen Date: Fri, 9 Jun 2023 14:58:58 +1000 Subject: [PATCH] cachix --- flake.nix | 2 ++ system/adrift.nix | 4 ++-- system/cachix.nix | 13 +++++++++++++ system/cachix/nix-community.nix | 13 +++++++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 system/cachix.nix create mode 100644 system/cachix/nix-community.nix diff --git a/flake.nix b/flake.nix index ee266ae..c9ddb84 100644 --- a/flake.nix +++ b/flake.nix @@ -73,6 +73,7 @@ specialArgs = {inherit inputs outputs;}; modules = [ ./system/quiver.nix + ./system/cachix.nix nur.nixosModules.nur nix-index-database.nixosModules.nix-index home-manager.nixosModules.home-manager @@ -89,6 +90,7 @@ specialArgs = {inherit inputs outputs;}; modules = [ ./system/adrift.nix + ./system/cachix.nix nur.nixosModules.nur nix-index-database.nixosModules.nix-index home-manager.nixosModules.home-manager diff --git a/system/adrift.nix b/system/adrift.nix index 3657498..ed83e38 100644 --- a/system/adrift.nix +++ b/system/adrift.nix @@ -9,8 +9,8 @@ ... }: { nix.settings = { - substituters = ["https://hyprland.cachix.org" "https://nix-community.cachix.org" ]; - trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; + substituters = ["https://hyprland.cachix.org" ]; + trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ]; trusted-users = [ "root" "bolt" ] }; diff --git a/system/cachix.nix b/system/cachix.nix new file mode 100644 index 0000000..ecd2d39 --- /dev/null +++ b/system/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/system/cachix/nix-community.nix b/system/cachix/nix-community.nix new file mode 100644 index 0000000..7fc4c65 --- /dev/null +++ b/system/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=" + ]; + }; + }; +}