···5454 };
55555656 uri = mkOption {
5757- type = types.str;
5757+ type = types.nullOr types.str;
5858 default = "postgresql:///atuin?host=/run/postgresql";
5959 example = "postgresql://atuin@localhost:5432/atuin";
6060- description = mdDoc "URI to the database";
6060+ description = mdDoc ''
6161+ URI to the database.
6262+ Can be set to null in which case ATUIN_DB_URI should be set through an EnvironmentFile
6363+ '';
6164 };
6265 };
6366 };
···134137 ATUIN_PORT = toString cfg.port;
135138 ATUIN_MAX_HISTORY_LENGTH = toString cfg.maxHistoryLength;
136139 ATUIN_OPEN_REGISTRATION = lib.boolToString cfg.openRegistration;
137137- ATUIN_DB_URI = cfg.database.uri;
138140 ATUIN_PATH = cfg.path;
139141 ATUIN_CONFIG_DIR = "/run/atuin"; # required to start, but not used as configuration is via environment variables
142142+ } // lib.optionalAttrs (cfg.database.uri != null) {
143143+ ATUIN_DB_URI = cfg.database.uri;
140144 };
141145 };
142146
+17
pkgs/by-name/at/atuin/package.nix
···11{ lib
22, stdenv
33, fetchFromGitHub
44+, fetchpatch
45, installShellFiles
56, rustPlatform
67, libiconv
···1920 hash = "sha256-fuVSn1vhKn2+Tw5f6zBYHFW3QSL4eisZ6d5pxsj5hh4=";
2021 };
21222323+ patches = [
2424+ # atuin with bash-preexec wasn't recording history properly after searching,
2525+ # backport recent fix until next release
2626+ (fetchpatch {
2727+ url = "https://github.com/atuinsh/atuin/commit/cb11af25afddbad552d337a9c82e74ac4302feca.patch";
2828+ sha256 = "sha256-cG99aLKs5msatT7vXiX9Rn5xur2WUjQ/U33nOxuon7I=";
2929+ })
3030+ ];
3131+2232 # TODO: unify this to one hash because updater do not support this
2333 cargoHash =
2434 if stdenv.isLinux
2535 then "sha256-lHWgsVnjSeBmd7O4Fn0pUtTn4XbkBOAouaRHRozil50="
2636 else "sha256-LxfpllzvgUu7ZuD97n3W+el3bdOt5QGXzJbDQ0w8seo=";
3737+3838+ # atuin's default features include 'check-updates', which do not make sense
3939+ # for distribution builds. List all other default features.
4040+ buildNoDefaultFeatures = true;
4141+ buildFeatures = [
4242+ "client" "sync" "server" "clipboard"
4343+ ];
27442845 nativeBuildInputs = [ installShellFiles ];
2946