-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsecrets.nix
65 lines (60 loc) · 1.88 KB
/
secrets.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{ config, lib, ... }:
let
serviceName = name: assert config.systemd.services ? "${name}" ; "${name}.service";
acmeService = serviceName "acme-tomaskrupka.cz";
inadynService = serviceName "inadyn";
vouchService = serviceName "vouch-proxy";
mosquittoService = serviceName "mosquitto";
resticService = serviceName "restic-backups-gcs";
in
{
config.sops = {
defaultSopsFile = ./secrets/gcp-instance.yaml;
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
secrets = {
"websupport/dns/api_key" = {
reloadUnits = [ acmeService ];
};
"websupport/dns/secret" = {
reloadUnits = [ acmeService ];
};
"websupport/dyn_dns/api_key" = {
reloadUnits = [ inadynService ];
};
"websupport/dyn_dns/secret" = {
reloadUnits = [ inadynService ];
};
"google/oauth/client_id" = {
restartUnits = [ vouchService ];
};
"google/oauth/secret" = {
restartUnits = [ vouchService ];
};
"vouch/jwt_secret" = {
restartUnits = [ vouchService ];
};
"mosquitto/red" = {
owner = config.users.users.mosquitto.name;
group = config.users.users.mosquitto.group;
restartUnits = [ mosquittoService ];
};
"mosquitto/tiny" = {
owner = config.users.users.mosquitto.name;
group = config.users.users.mosquitto.group;
restartUnits = [ mosquittoService ];
};
"restic/backup_password" = {
owner = config.users.users.backup.name;
group = config.users.users.backup.group;
reloadUnits = [ resticService ];
};
"restic/gcs_keys" = {
format = "binary";
sopsFile = ./secrets/authentic-scout-405520-ce3e009f013c.json;
owner = config.users.users.backup.name;
group = config.users.users.backup.group;
reloadUnits = [ resticService ];
};
};
};
}