feat: make cache public
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-08-30 12:30:35 -04:00
parent 717196a4e5
commit 265be6521c
3 changed files with 27 additions and 47 deletions

View file

@ -4,7 +4,14 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (lib) optionals; inherit (lib) foldl isList mergeAttrsWithFunc optionals unique;
mergeAttrsList = list:
foldl (mergeAttrsWithFunc (a: b:
if isList a && isList b
then unique (a ++ b)
else b)) {}
list;
in { in {
environment.systemPackages = [ environment.systemPackages = [
(pkgs.writeShellApplication { (pkgs.writeShellApplication {
@ -17,45 +24,22 @@ in {
]; ];
nix = { nix = {
settings = { settings = let
substituters = mkSubstituterConf = url: key: {
[ substituters = [url];
"https://hyprland.cachix.org" trusted-public-keys = optionals (key != null) [key];
"https://nix-gaming.cachix.org" };
# Nixpkgs-Wayland in
"https://cache.nixos.org" mergeAttrsList ([
"https://nixpkgs-wayland.cachix.org" (mkSubstituterConf "https://cache.nixos.org" "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=")
"https://nix-community.cachix.org" (mkSubstituterConf "https://hyprland.cachix.org" "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=")
# Nix-community (mkSubstituterConf "https://nix-gaming.cachix.org" "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=")
"https://nix-community.cachix.org" (mkSubstituterConf "https://nixpkgs-wayland.cachix.org" "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=")
# Nh (mkSubstituterConf "https://nix-community.cachix.org" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=")
"https://viperml.cachix.org" (mkSubstituterConf "https://viperml.cachix.org" "viperml.cachix.org-1:qZhKBMTfmcLL+OG6fj/hzsMEedgKvZVFRRAhq7j8Vh8=")
# Caddy
"https://caddycf.cachix.org"
] ]
++ optionals (!config.services.nix-serve.enable && config.services.tailscale.enable) [ ++ optionals (!config.services.nix-serve.enable) [
# Personal config cache (mkSubstituterConf "https://cache.nelim.org" "cache.nelim.org:JmFqkUdH11EA9EZOFAGVHuRYp7EbsdJDHvTQzG2pPyY=")
"https://cache.nelim.org" ]);
]
++ optionals (!config.services.nix-serve.enable && !config.services.tailscale.enable) [
"http://10.0.0.249:5000"
];
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
# Nixpkgs-Wayland
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
# Nix-community
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
# Nh
"viperml.cachix.org-1:qZhKBMTfmcLL+OG6fj/hzsMEedgKvZVFRRAhq7j8Vh8="
# Caddy
"caddycf.cachix.org-1:6vbQaeiec/zKv9XfEwi9yWVCe7opbeJMu6w81UEXugY="
# Personal config cache
"cache.nelim.org:JmFqkUdH11EA9EZOFAGVHuRYp7EbsdJDHvTQzG2pPyY="
];
};
}; };
} }

View file

@ -1,7 +1,6 @@
{ {
config, config,
jovian, jovian,
lib,
modulesPath, modulesPath,
... ...
}: { }: {
@ -62,5 +61,5 @@
} }
]; ];
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.amd.updateMicrocode = config.hardware.enableRedistributableFirmware;
} }

View file

@ -82,6 +82,8 @@ in {
"Immich" = mkPublicReverseProxy "photos" "${nosIP}:2283" {}; "Immich" = mkPublicReverseProxy "photos" "${nosIP}:2283" {};
"Binary Cache" = mkPublicReverseProxy "cache" "${serviviIP}:5000" {};
# Private # Private
"nelim.org" = { "nelim.org" = {
serverAliases = ["*.nelim.org"]; serverAliases = ["*.nelim.org"];
@ -107,11 +109,6 @@ in {
''; '';
}; };
nix-binary-cache = {
subDomainName = "cache";
reverseProxy = "${serviviIP}:5000";
};
# Resume builder # Resume builder
resume.reverseProxy = "${nosIP}:3060"; resume.reverseProxy = "${nosIP}:3060";
resauth.reverseProxy = "${nosIP}:3100"; resauth.reverseProxy = "${nosIP}:3100";