From 947c25330f3df0192d129974b85ab8675503fe91 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Thu, 21 Mar 2024 23:08:56 +0100 Subject: [PATCH] Add binary cache support --- system/default.nix | 2 +- system/nix/cachix.nix | 25 +++++++++++++++++++++++++ system/{nix.nix => nix/default.nix} | 10 ++++++++-- 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 system/nix/cachix.nix rename system/{nix.nix => nix/default.nix} (92%) diff --git a/system/default.nix b/system/default.nix index d589af8..f3cd87d 100644 --- a/system/default.nix +++ b/system/default.nix @@ -4,8 +4,8 @@ _: { ./boot ./services ./programs + ./nix ./system.nix - ./nix.nix ./network.nix ./localisation.nix ]; diff --git a/system/nix/cachix.nix b/system/nix/cachix.nix new file mode 100644 index 0000000..89f170c --- /dev/null +++ b/system/nix/cachix.nix @@ -0,0 +1,25 @@ +_: { + nix.settings = { + # Set up various binary cache providers, compiling everything is too slow and annoying + # these will be used on all machines, but there's really no reason not to include all + # providers, even if we won't pull some of the packages these cache + substituters = [ + "https://cache.nixos.org" + "https://nix-community.cachix.org" # nix-community flake + "https://nixpkgs-unfree.cachix.org" # unfree-package cache + "https://numtide.cachix.org" # another unfree package cache + "https://nixpkgs-wayland.cachix.org" # automated builds of *some* wayland packages + "https://hyprland.cachix.org" # hyprland + "https://ags.cachix.org" # ags + ]; + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "nixpkgs-unfree.cachix.org-1:hqvoInulhbV4nJ9yJOEr+4wxhDV4xq2d1DK7S6Nj6rs=" + "numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE=" + "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + "ags.cachix.org-1:naAvMrz0CuYqeyGNyLgE010iUiuf/qx6kYrUv3NwAJ8=" + ]; + }; +} diff --git a/system/nix.nix b/system/nix/default.nix similarity index 92% rename from system/nix.nix rename to system/nix/default.nix index 461d636..f57603c 100644 --- a/system/nix.nix +++ b/system/nix/default.nix @@ -1,5 +1,10 @@ -{pkgs, ...}: +{ pkgs, ... }: { + + imports = [ + ./cachix.nix + ]; + system.autoUpgrade.enable = false; nix = { @@ -37,5 +42,6 @@ nixpkgs.config.allowUnfree = true; # Git is needed for flakes - environment.systemPackages = [pkgs.git]; + environment.systemPackages = [ pkgs.git ]; } +