1
1
Fork 0

headscale: initial disabled container

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2024-09-10 21:26:47 -05:00
parent a1aabe4528
commit a4de5f3324
Signed by: myned
GPG key ID: C7224454F7881A34
4 changed files with 69 additions and 0 deletions

View file

@ -0,0 +1,67 @@
{
config,
inputs,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.custom.settings.containers.headscale;
in
{
options.custom.settings.containers.headscale.enable = mkOption { default = false; };
config = mkIf cfg.enable {
age.secrets =
let
secret = filename: {
file = "${inputs.self}/secrets/${filename}";
};
in
{
"${config.custom.profile}/headscale/.env" = secret "${config.custom.profile}/headscale/.env";
};
#?? arion-headscale pull
environment.shellAliases.arion-headscale = "sudo arion --prebuilt-file ${config.virtualisation.arion.projects.headscale.settings.out.dockerComposeYaml}";
virtualisation.arion.projects.headscale = {
serviceName = "headscale";
settings.services = {
# https://headscale.net/
# https://github.com/juanfont/headscale
# BUG: Does not support generic DoH/DoT
# https://github.com/juanfont/headscale/issues/1312
headscale.service = {
command = "serve";
container_name = "headscale";
env_file = [ config.age.secrets."${config.custom.profile}/headscale/.env".path ];
image = "headscale/headscale:v0.23.0-beta.4";
restart = "unless-stopped";
ports = [
"9999:9999"
"9090:9090"
];
volumes = [
"${config.custom.settings.containers.directory}/headscale/config:/etc/headscale"
"${config.custom.settings.containers.directory}/headscale/data:/var/lib/headscale"
# Minimum config.yaml
# https://github.com/juanfont/headscale/blob/main/config-example.yaml
# https://github.com/juanfont/headscale/blob/main/integration/hsic/config.go
"${pkgs.writeText "config.yaml" ''
noise:
private_key_path: /var/lib/headscale/noise_private.key
''}:/etc/headscale/config.yaml"
];
};
};
};
};
}

View file

@ -55,6 +55,7 @@
coturn.enable = true; coturn.enable = true;
forgejo.enable = true; forgejo.enable = true;
foundryvtt.enable = true; foundryvtt.enable = true;
#// headscale.enable = true;
mastodon.enable = true; mastodon.enable = true;
nextcloud.enable = true; nextcloud.enable = true;
redlib.enable = true; redlib.enable = true;

View file

@ -73,6 +73,7 @@ in
"server/forgejo/.env".publicKeys = server; "server/forgejo/.env".publicKeys = server;
"server/forgejo/db.env".publicKeys = server; "server/forgejo/db.env".publicKeys = server;
"server/foundryvtt/.env".publicKeys = server; "server/foundryvtt/.env".publicKeys = server;
"server/headscale/.env".publicKeys = server;
"server/mastodon/.env".publicKeys = server; "server/mastodon/.env".publicKeys = server;
"server/mastodon/db.env".publicKeys = server; "server/mastodon/db.env".publicKeys = server;
"server/matrix-conduit/conduwuit.toml".publicKeys = server; "server/matrix-conduit/conduwuit.toml".publicKeys = server;

Binary file not shown.