12 { name, config, ... }:
19 description = "Whether to enable proxy for this bucket";
21 bucketName = mkOption {
24 example = "my-bucket-name";
25 description = "Name of Google storage bucket";
29 example = "localhost:3000";
30 description = "The address of the proxy.";
34 enabledProxies = lib.filterAttrs (n: v: v.enable) config.services.nix-store-gcs-proxy;
35 mapProxies = function: lib.mkMerge (lib.mapAttrsToList function enabledProxies);
38 options.services.nix-store-gcs-proxy = mkOption {
39 type = types.attrsOf (types.submodule opts);
42 An attribute set describing an HTTP to GCS proxy that allows us to use GCS
43 bucket via HTTP protocol.
47 config.systemd.services = mapProxies (
49 "nix-store-gcs-proxy-${name}" = {
50 description = "A HTTP nix store that proxies requests to Google Storage";
51 wantedBy = [ "multi-user.target" ];
53 startLimitIntervalSec = 10;
57 ${pkgs.nix-store-gcs-proxy}/bin/nix-store-gcs-proxy \
58 --bucket-name ${cfg.bucketName} \
64 ProtectSystem = "strict";
67 PrivateDevices = true;
71 ProtectKernelTunables = true;
72 ProtectKernelModules = true;
73 ProtectControlGroups = true;
75 NoNewPrivileges = true;
76 LockPersonality = true;
77 RestrictRealtime = true;
83 meta.maintainers = [ maintainers.mrkkrp ];