mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-07-03 07:47:20 +02:00
Added bincache
This commit is contained in:
parent
8cbfd7562b
commit
7c0c58b3d2
3 changed files with 49 additions and 0 deletions
|
@ -14,6 +14,10 @@
|
||||||
luj = {
|
luj = {
|
||||||
mediaserver.enable = true;
|
mediaserver.enable = true;
|
||||||
homepage.enable = true;
|
homepage.enable = true;
|
||||||
|
bincache = {
|
||||||
|
enable = true;
|
||||||
|
subdomain = "bin";
|
||||||
|
};
|
||||||
drone = {
|
drone = {
|
||||||
enable = true;
|
enable = true;
|
||||||
nginx = {
|
nginx = {
|
||||||
|
|
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}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -25,6 +25,14 @@ with lib;
|
||||||
nixPath = [
|
nixPath = [
|
||||||
"nixpkgs=${inputs.nixpkgs}"
|
"nixpkgs=${inputs.nixpkgs}"
|
||||||
];
|
];
|
||||||
|
binaryCaches = [
|
||||||
|
"https://bin.julienmalka.me"
|
||||||
|
"https://cache.nixos.org/"
|
||||||
|
];
|
||||||
|
binaryCachePublicKeys = [
|
||||||
|
"bin.julienmalka.me:y0uADfX8ZQ6Pthofm8Pj7v+hED3m2cY0d+Sg6/Jm+s8="
|
||||||
|
];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue