···54 };
5556 uri = mkOption {
57- type = types.str;
58 default = "postgresql:///atuin?host=/run/postgresql";
59 example = "postgresql://atuin@localhost:5432/atuin";
60- description = mdDoc "URI to the database";
00061 };
62 };
63 };
···134 ATUIN_PORT = toString cfg.port;
135 ATUIN_MAX_HISTORY_LENGTH = toString cfg.maxHistoryLength;
136 ATUIN_OPEN_REGISTRATION = lib.boolToString cfg.openRegistration;
137- ATUIN_DB_URI = cfg.database.uri;
138 ATUIN_PATH = cfg.path;
139 ATUIN_CONFIG_DIR = "/run/atuin"; # required to start, but not used as configuration is via environment variables
00140 };
141 };
142
···54 };
5556 uri = mkOption {
57+ type = types.nullOr types.str;
58 default = "postgresql:///atuin?host=/run/postgresql";
59 example = "postgresql://atuin@localhost:5432/atuin";
60+ description = mdDoc ''
61+ URI to the database.
62+ Can be set to null in which case ATUIN_DB_URI should be set through an EnvironmentFile
63+ '';
64 };
65 };
66 };
···137 ATUIN_PORT = toString cfg.port;
138 ATUIN_MAX_HISTORY_LENGTH = toString cfg.maxHistoryLength;
139 ATUIN_OPEN_REGISTRATION = lib.boolToString cfg.openRegistration;
0140 ATUIN_PATH = cfg.path;
141 ATUIN_CONFIG_DIR = "/run/atuin"; # required to start, but not used as configuration is via environment variables
142+ } // lib.optionalAttrs (cfg.database.uri != null) {
143+ ATUIN_DB_URI = cfg.database.uri;
144 };
145 };
146
+17
pkgs/by-name/at/atuin/package.nix
···1{ lib
2, stdenv
3, fetchFromGitHub
04, installShellFiles
5, rustPlatform
6, libiconv
···19 hash = "sha256-fuVSn1vhKn2+Tw5f6zBYHFW3QSL4eisZ6d5pxsj5hh4=";
20 };
2100000000022 # TODO: unify this to one hash because updater do not support this
23 cargoHash =
24 if stdenv.isLinux
25 then "sha256-lHWgsVnjSeBmd7O4Fn0pUtTn4XbkBOAouaRHRozil50="
26 else "sha256-LxfpllzvgUu7ZuD97n3W+el3bdOt5QGXzJbDQ0w8seo=";
00000002728 nativeBuildInputs = [ installShellFiles ];
29
···1{ lib
2, stdenv
3, fetchFromGitHub
4+, fetchpatch
5, installShellFiles
6, rustPlatform
7, libiconv
···20 hash = "sha256-fuVSn1vhKn2+Tw5f6zBYHFW3QSL4eisZ6d5pxsj5hh4=";
21 };
2223+ patches = [
24+ # atuin with bash-preexec wasn't recording history properly after searching,
25+ # backport recent fix until next release
26+ (fetchpatch {
27+ url = "https://github.com/atuinsh/atuin/commit/cb11af25afddbad552d337a9c82e74ac4302feca.patch";
28+ sha256 = "sha256-cG99aLKs5msatT7vXiX9Rn5xur2WUjQ/U33nOxuon7I=";
29+ })
30+ ];
31+32 # TODO: unify this to one hash because updater do not support this
33 cargoHash =
34 if stdenv.isLinux
35 then "sha256-lHWgsVnjSeBmd7O4Fn0pUtTn4XbkBOAouaRHRozil50="
36 else "sha256-LxfpllzvgUu7ZuD97n3W+el3bdOt5QGXzJbDQ0w8seo=";
37+38+ # atuin's default features include 'check-updates', which do not make sense
39+ # for distribution builds. List all other default features.
40+ buildNoDefaultFeatures = true;
41+ buildFeatures = [
42+ "client" "sync" "server" "clipboard"
43+ ];
4445 nativeBuildInputs = [ installShellFiles ];
46