-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Cleanup: hosts/binarycache configuration"
This reverts commit 47ab96b. Signed-off-by: Marko Lindqvist <[email protected]>
- Loading branch information
Marko Lindqvist
committed
Dec 12, 2024
1 parent
1404fe5
commit 5c94462
Showing
2 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,12 @@ | |
self, | ||
inputs, | ||
lib, | ||
config, | ||
... | ||
}: | ||
{ | ||
sops.defaultSopsFile = ./secrets.yaml; | ||
sops.secrets.cache-sig-key.owner = "root"; | ||
|
||
imports = | ||
[ | ||
|
@@ -18,20 +20,54 @@ | |
] | ||
++ (with self.nixosModules; [ | ||
common | ||
qemu-common | ||
ficolo-common | ||
service-openssh | ||
service-binary-cache | ||
service-nginx | ||
user-jrautiola | ||
user-cazfi | ||
user-hrosten | ||
user-mkaapu | ||
user-avnik | ||
]); | ||
|
||
nix.settings = { | ||
# we don't want the cache to be a substitutor for itself | ||
substituters = lib.mkForce [ "https://cache.nixos.org/" ]; | ||
}; | ||
|
||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; | ||
networking.hostName = "binarycache"; | ||
|
||
networking = { | ||
hostName = "binarycache"; | ||
}; | ||
|
||
security.acme = { | ||
acceptTerms = true; | ||
defaults.email = "[email protected]"; | ||
}; | ||
|
||
services.monitoring = { | ||
metrics.enable = true; | ||
logs.enable = true; | ||
}; | ||
|
||
services.nginx = { | ||
recommendedZstdSettings = true; | ||
virtualHosts = { | ||
"cache.vedenemo.dev" = { | ||
enableACME = true; | ||
forceSSL = true; | ||
default = true; | ||
locations."/" = { | ||
proxyPass = "http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}"; | ||
extraConfig = '' | ||
zstd on; | ||
zstd_types application/x-nix-archive; | ||
''; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# SPDX-FileCopyrightText: 2022-2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{ config, ... }: | ||
{ | ||
services = { | ||
harmonia = { | ||
enable = true; | ||
signKeyPath = config.sops.secrets.cache-sig-key.path; | ||
}; | ||
}; | ||
networking.firewall.allowedTCPPorts = [ 5000 ]; | ||
} |