forked from colonelpanic/dotfiles
[NixOS] Set up cache server
This commit is contained in:
20
nixos/cache-server.nix
Normal file
20
nixos/cache-server.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ config, makeEnable, ... }:
|
||||
makeEnable config "modules.cache-server" false {
|
||||
age.secrets."cache-priv-key.pem".file = ./secrets/cache-priv-key.pem.age;
|
||||
|
||||
services.nix-serve = {
|
||||
enable = true;
|
||||
secretKeyFile = config.age.secrets."cache-priv-key.pem".path;
|
||||
port = 5050;
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
recommendedProxySettings = true;
|
||||
virtualHosts = {
|
||||
"0.0.0.0" = {
|
||||
locations."/".proxyPass = "http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user