mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-06-08 10:09:04 +02:00
Added bincache
This commit is contained in:
parent
8103e8e236
commit
18cd7a5c8b
4 changed files with 52 additions and 2 deletions
37
modules/bincache/default.nix
Normal file
37
modules/bincache/default.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{ pkgs, config, lib, inputs, ... }:
|
||||
let
|
||||
cfg = config.luj.bincache;
|
||||
port = 5000;
|
||||
in
|
||||
with lib;
|
||||
{
|
||||
options.luj.bincache = {
|
||||
enable = mkEnableOption "Enable nix bincache";
|
||||
subdomain = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable
|
||||
{
|
||||
sops.secrets.bin-cache-priv-key = {
|
||||
owner = "nix-serve";
|
||||
};
|
||||
|
||||
services.nix-serve = {
|
||||
enable = true;
|
||||
secretKeyFile = "/run/secrets/bin-cache-priv-key";
|
||||
port = port;
|
||||
};
|
||||
|
||||
luj.nginx.enable = true;
|
||||
services.nginx.virtualHosts."${cfg.subdomain}.julienmalka.me" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${toString port}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue