Initial commit
This commit is contained in:
commit
430194beda
109 changed files with 9066 additions and 0 deletions
24
hosts/cryodev-pi/services/comin.nix
Normal file
24
hosts/cryodev-pi/services/comin.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
outputs,
|
||||
constants,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
outputs.nixosModules.comin
|
||||
];
|
||||
|
||||
services.comin = {
|
||||
enable = true;
|
||||
remotes = [
|
||||
{
|
||||
name = "origin";
|
||||
url = "https://${constants.services.forgejo.fqdn}/steffen/cryodev-server.git";
|
||||
branches.main.name = "main";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
9
hosts/cryodev-pi/services/default.nix
Normal file
9
hosts/cryodev-pi/services/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
imports = [
|
||||
./nginx.nix
|
||||
./openssh.nix
|
||||
./tailscale.nix
|
||||
./netdata.nix
|
||||
./comin.nix
|
||||
];
|
||||
}
|
||||
31
hosts/cryodev-pi/services/netdata.nix
Normal file
31
hosts/cryodev-pi/services/netdata.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
outputs,
|
||||
constants,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
services.netdata = {
|
||||
enable = true;
|
||||
config = {
|
||||
stream = {
|
||||
enabled = "yes";
|
||||
destination = "${constants.hosts.cryodev-main.ip}:${toString constants.services.netdata.port}";
|
||||
"api key" = config.sops.placeholder."netdata/stream/child-uuid";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Make sure sops is enabled/imported for this host to handle the secret
|
||||
imports = [ outputs.nixosModules.sops ];
|
||||
|
||||
sops = {
|
||||
defaultSopsFile = ../secrets.yaml;
|
||||
secrets."netdata/stream/child-uuid" = {
|
||||
owner = "netdata";
|
||||
group = "netdata";
|
||||
};
|
||||
};
|
||||
}
|
||||
14
hosts/cryodev-pi/services/nginx.nix
Normal file
14
hosts/cryodev-pi/services/nginx.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
outputs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ outputs.nixosModules.nginx ];
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
forceSSL = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
}
|
||||
12
hosts/cryodev-pi/services/openssh.nix
Normal file
12
hosts/cryodev-pi/services/openssh.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
outputs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
outputs.nixosModules.openssh
|
||||
];
|
||||
|
||||
services.openssh.enable = true;
|
||||
}
|
||||
28
hosts/cryodev-pi/services/tailscale.nix
Normal file
28
hosts/cryodev-pi/services/tailscale.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
outputs,
|
||||
constants,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
outputs.nixosModules.tailscale
|
||||
];
|
||||
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
# Connect to our own headscale instance
|
||||
loginServer = "https://${constants.services.headscale.fqdn}";
|
||||
# Allow SSH access over Tailscale
|
||||
enableSSH = true;
|
||||
# Use MagicDNS names
|
||||
acceptDNS = true;
|
||||
|
||||
# Auth key for automated enrollment
|
||||
authKeyFile = config.sops.secrets."tailscale/auth-key".path;
|
||||
};
|
||||
|
||||
sops.secrets."tailscale/auth-key" = { };
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue