Merge pull request #290719 from martinetd/atuin

atuin: small fixes

authored by 0x4A6F and committed by GitHub 97bca14e cf9209e7

+24 -3
+7 -3
nixos/modules/services/misc/atuin.nix
··· 54 54 }; 55 55 56 56 uri = mkOption { 57 - type = types.str; 57 + type = types.nullOr types.str; 58 58 default = "postgresql:///atuin?host=/run/postgresql"; 59 59 example = "postgresql://atuin@localhost:5432/atuin"; 60 - description = mdDoc "URI to the database"; 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 + ''; 61 64 }; 62 65 }; 63 66 }; ··· 134 137 ATUIN_PORT = toString cfg.port; 135 138 ATUIN_MAX_HISTORY_LENGTH = toString cfg.maxHistoryLength; 136 139 ATUIN_OPEN_REGISTRATION = lib.boolToString cfg.openRegistration; 137 - ATUIN_DB_URI = cfg.database.uri; 138 140 ATUIN_PATH = cfg.path; 139 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; 140 144 }; 141 145 }; 142 146
+17
pkgs/by-name/at/atuin/package.nix
··· 1 1 { lib 2 2 , stdenv 3 3 , fetchFromGitHub 4 + , fetchpatch 4 5 , installShellFiles 5 6 , rustPlatform 6 7 , libiconv ··· 19 20 hash = "sha256-fuVSn1vhKn2+Tw5f6zBYHFW3QSL4eisZ6d5pxsj5hh4="; 20 21 }; 21 22 23 + 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 + 22 32 # TODO: unify this to one hash because updater do not support this 23 33 cargoHash = 24 34 if stdenv.isLinux 25 35 then "sha256-lHWgsVnjSeBmd7O4Fn0pUtTn4XbkBOAouaRHRozil50=" 26 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 + ]; 27 44 28 45 nativeBuildInputs = [ installShellFiles ]; 29 46