bos55-nix-config-cicd/modules/common/substituters.nix
Tibo De Peuter ffe7572c7d
Some checks failed
Build / build (Development) (push) Has been skipped
Build / Determining hosts to build (push) Failing after 1s
Build / build (Testing) (push) Has been skipped
feat: implement Attic binary cache with remote build support and sops-nix integration
2026-03-17 18:31:43 +01:00

28 lines
816 B
Nix

{ config, lib, pkgs, inputs, ... }:
let
cfg = config.homelab.common.substituters;
in {
options.homelab.common.substituters = {
enable = lib.mkEnableOption "Binary cache substituters";
domain = lib.mkOption {
type = lib.types.str;
default = inputs.self.nixosConfigurations.BinaryCache.config.homelab.services.attic.domain;
description = "The domain name of the binary cache.";
};
publicKey = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "The public key of the Attic cache (e.g., 'homelab:...')";
};
};
config = lib.mkIf cfg.enable {
nix.settings = {
substituters = [
"https://${cfg.domain}"
];
trusted-public-keys = lib.optional (cfg.publicKey != null) cfg.publicKey;
};
};
}