fix(signing): add signing to hydra
This commit is contained in:
parent
e03a579a93
commit
22d238c29e
3 changed files with 37 additions and 19 deletions
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
nixConfig = {
|
||||
extra-substituters = [
|
||||
"https://zackartz.cachix.org"
|
||||
"https://hydra.zoeys.computer"
|
||||
];
|
||||
extra-trusted-public-keys = [
|
||||
"zackartz.cachix.org-1:nrEfVZF8MVX0Lnt73KwYzH2kwDzFuAoR5VPjuUd4R30="
|
||||
"hydra.zoeys.computer-1:ssh-ed25519:0000000b7373682d65643235353139000000205f061b28bd7b23ff28347b79ac7719587c471904487cebc19172a682240256cc"
|
||||
];
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -7,17 +7,31 @@
|
|||
with lib;
|
||||
with lib.custom; let
|
||||
cfg = config.sites.hydra;
|
||||
|
||||
sec = config.age.secrets;
|
||||
in {
|
||||
options.sites.hydra = with types; {
|
||||
enable = mkBoolOpt false "Enable Hydra";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
age.secrets = {
|
||||
hydra_key = {
|
||||
owner = "hydra";
|
||||
group = "hydra";
|
||||
file = ./sec/hydra_key.age;
|
||||
};
|
||||
};
|
||||
|
||||
services.hydra = {
|
||||
enable = true;
|
||||
hydraURL = "https://hydra.zoeys.computer";
|
||||
useSubstitutes = true;
|
||||
notificationSender = "hydra@localhost"; # e-mail of hydra service
|
||||
|
||||
extraConfig = ''
|
||||
binary_cache_secret_key_file = ${sec.hydra_key.path}
|
||||
'';
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."hydra.zoeys.computer" = {
|
||||
|
|
@ -28,23 +42,27 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
nix.settings.allowed-uris = [
|
||||
"github:"
|
||||
"https://github.com"
|
||||
"git+https://github.com/"
|
||||
"git+ssh://github.com/"
|
||||
"git+https://git.zoeys.computer/"
|
||||
"git+ssh://git.zoeys.computer/"
|
||||
];
|
||||
users.users.hydra.extraGroups = ["keys"];
|
||||
|
||||
nix.buildMachines = [
|
||||
{
|
||||
hostName = "localhost";
|
||||
protocol = null;
|
||||
system = "x86_64-linux";
|
||||
supportedFeatures = ["kvm" "nixos-test" "big-parallel" "benchmark"];
|
||||
maxJobs = 8;
|
||||
}
|
||||
];
|
||||
nix = {
|
||||
settings.allowed-uris = [
|
||||
"github:"
|
||||
"https://github.com"
|
||||
"git+https://github.com/"
|
||||
"git+ssh://github.com/"
|
||||
"git+https://git.zoeys.computer/"
|
||||
"git+ssh://git.zoeys.computer/"
|
||||
];
|
||||
trustedUsers = ["hydra"]; # Ensure hydra user is trusted for nix
|
||||
buildMachines = [
|
||||
{
|
||||
hostName = "localhost";
|
||||
protocol = null;
|
||||
system = "x86_64-linux";
|
||||
supportedFeatures = ["kvm" "nixos-test" "big-parallel" "benchmark"];
|
||||
maxJobs = 8;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
BIN
modules/nixos/sites/hydra/sec/hydra_key.age
Normal file
BIN
modules/nixos/sites/hydra/sec/hydra_key.age
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue