From 662f2b84fd7cd5b815597fd0e013ef8292a48ae6 Mon Sep 17 00:00:00 2001 From: Patrick Jackson Date: Fri, 31 Mar 2023 01:58:57 -0600 Subject: [PATCH] fix: allow nix package to fetch dependencies from git (#832) This change saves us from needing to keep a copy of the checksum in atuin.nix, so that Cargo.lock can remain as the sole source of truth for the dependency versions. --- atuin.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/atuin.nix b/atuin.nix index 606e687..262f570 100644 --- a/atuin.nix +++ b/atuin.nix @@ -1,19 +1,28 @@ +# Atuin package definition +# +# This file will be similar to the package definition in nixpkgs: +# https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/misc/atuin/default.nix +# +# Helpful documentation: https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/rust.section.md { lib, stdenv, - fetchFromGitHub, installShellFiles, rustPlatform, libiconv, Security, SystemConfiguration, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage { name = "atuin"; src = lib.cleanSource ./.; - cargoLock.lockFile = ./Cargo.lock; + cargoLock = { + lockFile = ./Cargo.lock; + # Allow dependencies to be fetched from git and avoid having to set the outputHashes manually + allowBuiltinFetchGit = true; + }; nativeBuildInputs = [installShellFiles];