diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-05-05 11:25:42 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-05-05 12:28:25 +0200 |
commit | d65099b57d7b30c152185cc5f74830b67f09ca62 (patch) | |
tree | 9ce27f68dad5b45fd15a8ef8d5683946ea4ac098 /modules/by-name/at | |
parent | modules/matrix: Provide postgresql with a correct sql statement (diff) | |
download | nixos-server-d65099b57d7b30c152185cc5f74830b67f09ca62.zip |
modules/atuin-sync: Init
Diffstat (limited to 'modules/by-name/at')
-rw-r--r-- | modules/by-name/at/atuin-sync/module.nix | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/modules/by-name/at/atuin-sync/module.nix b/modules/by-name/at/atuin-sync/module.nix new file mode 100644 index 0000000..0db2e29 --- /dev/null +++ b/modules/by-name/at/atuin-sync/module.nix @@ -0,0 +1,45 @@ +{ + config, + lib, + vhackPackages, + ... +}: let + cfg = config.vhack.atuin-sync; +in { + options.vhack.atuin-sync = { + enable = lib.mkEnableOption "atuin sync server"; + + fqdn = lib.mkOption { + description = "The fully qualified domain name of this instance."; + type = lib.types.str; + example = "atuin-sync.atuin.sh"; + }; + }; + + config = lib.mkIf cfg.enable { + vhack.nginx.enable = true; + + services = { + nginx.virtualHosts."${cfg.fqdn}" = { + locations."/" = { + proxyPass = "http://127.0.0.1:${toString config.services.atuin.port}"; + recommendedProxySettings = true; + }; + + enableACME = true; + forceSSL = true; + }; + + atuin = { + enable = true; + package = vhackPackages.atuin-server-only; + host = "127.0.0.1"; + + # Nobody knows about the fqdn and even if, they can only upload encrypted blobs. + openRegistration = true; + + database.createLocally = true; + }; + }; + }; +} |