fix(midnight): stop using cache.freshlybakedca.ke #108

merged
opened by a.starrysky.fyi targeting main from private/minion/push-wznllvxvuqmz

Midnight hosts cache.freshlybakedca.ke, so there are problems (errors) if it tries to use it too.

Since as there's no process to filter out of a list of values without losing the rest of the list (*except evaluating twice through scalpel like processes), we need to disable this at the source. That means it's best to pull this out into an ingredient and detect whether the ingredient is enabled for turning the cache on/off...

Changed files
+25 -8
packetmix
systems
+24 -8
packetmix/systems/common/packetmix.nix
··· 5 5 # packetmix.nix: packetmix support configuration, including our binary cache and auto-updating 6 6 { config, pkgs, ... }: 7 7 { 8 - nix.settings.substituters = [ 9 - "https://cache.freshlybakedca.ke" 10 - "https://freshlybakedcake.cachix.org" 11 - ]; 12 - nix.settings.trusted-public-keys = [ 13 - "cache.freshlybakedca.ke-1:WD7CED6MwAxxOzgHlrHVbcVdYeqSa2mwBwR3vNuCJvg=" 14 - "freshlybakedcake.cachix.org-1:YmhsHdeKjqbaS33PPJXJllTHBupT3hliQrPcllJXkE0=" 15 - ]; 8 + nix.settings.substituters = 9 + ( 10 + if !config.ingredient.nix-serve.enable then 11 + [ 12 + "https://cache.freshlybakedca.ke" 13 + ] 14 + else 15 + [ ] 16 + ) 17 + ++ [ 18 + "https://freshlybakedcake.cachix.org" 19 + ]; 20 + nix.settings.trusted-public-keys = 21 + ( 22 + if !config.ingredient.nix-serve.enable then 23 + [ 24 + "cache.freshlybakedca.ke-1:WD7CED6MwAxxOzgHlrHVbcVdYeqSa2mwBwR3vNuCJvg=" 25 + ] 26 + else 27 + [ ] 28 + ) 29 + ++ [ 30 + "freshlybakedcake.cachix.org-1:YmhsHdeKjqbaS33PPJXJllTHBupT3hliQrPcllJXkE0=" 31 + ]; 16 32 17 33 system.autoUpgrade = { 18 34 enable = true;
+1
packetmix/systems/default.nix
··· 89 89 pkgs = nixpkgs.x86_64-linux; 90 90 ingredients = [ 91 91 "freshlybakedcake" 92 + "nix-serve" 92 93 "server" 93 94 ]; 94 95 args = {
packetmix/systems/midnight/cache.nix packetmix/systems/nix-serve/cache.nix