feat(ops/modules): Add shared module for TVL cache
Add a shared nixos module for configuring whitby as a binary nix cache, and refactor tverskoy to use this module. This is enabled via an option to pave the way for including it as an import in all depot-generated nixos configs at some point in the future. Change-Id: I6dcc0e8eb48b1ac34457666dceebeedd5da6c526 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4344 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: wpcarro <wpcarro@gmail.com> Autosubmit: grfn <grfn@gws.fyi>
This commit is contained in:
parent
47f1f3be5f
commit
0f5cc25697
2 changed files with 21 additions and 9 deletions
19
ops/modules/tvl-cache.nix
Normal file
19
ops/modules/tvl-cache.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
options = {
|
||||
tvl.cache.enable = lib.mkEnableOption "the TVL binary cache";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.tvl.cache.enable {
|
||||
nix = {
|
||||
binaryCachePublicKeys = [
|
||||
"cache.tvl.su:kjc6KOMupXc1vHVufJUoDUYeLzbwSr9abcAKdn/U1Jk="
|
||||
];
|
||||
|
||||
binaryCaches = [
|
||||
"https://cache.tvl.su"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -19,18 +19,11 @@ in lib.fix(self: {
|
|||
imports = [
|
||||
"${depot.third_party.impermanence}/nixos.nix"
|
||||
"${depot.path + "/ops/modules/automatic-gc.nix"}"
|
||||
"${depot.path + "/ops/modules/tvl-cache.nix"}"
|
||||
"${pkgs.home-manager.src}/nixos"
|
||||
];
|
||||
|
||||
nix = {
|
||||
binaryCachePublicKeys = [
|
||||
"cache.tvl.su:kjc6KOMupXc1vHVufJUoDUYeLzbwSr9abcAKdn/U1Jk="
|
||||
];
|
||||
|
||||
binaryCaches = [
|
||||
"https://cache.tvl.su"
|
||||
];
|
||||
};
|
||||
tvl.cache.enable = true;
|
||||
|
||||
boot = rec {
|
||||
initrd.availableKernelModules = [ "nvme" "ehci_pci" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
|
||||
|
|
Loading…
Reference in a new issue