diff --git a/modules/home/programs/atuin.nix b/modules/home/programs/atuin.nix new file mode 100644 index 0000000..6d701a8 --- /dev/null +++ b/modules/home/programs/atuin.nix @@ -0,0 +1,22 @@ +{ + config, + osConfig, + pkgs, + lib, + ... +}: +{ + options.custom.programs.atuin.enable = lib.mkEnableOption ""; + + config = lib.mkIf config.custom.programs.atuin.enable { + programs.atuin = { + enable = true; + forceOverwriteSettings = true; + flags = [ "--disable-up-arrow" ]; + settings = { + sync_address = "https://atuin.${osConfig.custom.networking.overlay.domain}"; + key_path = pkgs.writeText "atuin-key" "3AAgzNnMicyALmrMt8ywzL/Mv3LMkEI/zKdPzLDMwCB9KCAwWsybzOrMn8zmzLZszIgMMQ==\n"; + }; + }; + }; +} diff --git a/modules/system/web-services/atuin.nix b/modules/system/web-services/atuin.nix new file mode 100644 index 0000000..d660014 --- /dev/null +++ b/modules/system/web-services/atuin.nix @@ -0,0 +1,27 @@ +{ config, lib, ... }: +let + cfg = config.custom.web-services.atuin; +in +{ + options.custom.web-services.atuin = { + enable = lib.mkEnableOption ""; + domain = lib.mkOption { + type = lib.types.nonEmptyStr; + default = ""; + }; + port = lib.mkOption { + type = lib.types.port; + default = 8849; + }; + }; + + config = lib.mkIf cfg.enable { + services.atuin = { + enable = true; + openRegistration = true; + inherit (cfg) port; + }; + + custom.services.caddy.virtualHosts.${cfg.domain}.port = cfg.port; + }; +}