headscale: initial disabled container
Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
parent
a1aabe4528
commit
a4de5f3324
4 changed files with 69 additions and 0 deletions
67
options/custom/settings/containers/headscale.nix
Normal file
67
options/custom/settings/containers/headscale.nix
Normal 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"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
BIN
secrets/server/headscale/.env
Normal file
BIN
secrets/server/headscale/.env
Normal file
Binary file not shown.
Loading…
Reference in a new issue