Hi all,
I built a local utility script in Rust that I’d like to include as a package in my home-manager configuration. I have this currently, which I saw example code from How to package a Rust app using Nix - DEV Community
home.packages = [
(pkgs.rustPlatform.buildRustPackage {
pname = "couleur";
version = "0.1.0";
src = pkgs.lib.cleanSource "${config.home.homeDirectory}/.dotfiles/scripts/couleur";
cargoLock.lockFile = "${config.home.homeDirectory}/.dotfiles/scripts/couleur/Cargo.lock";
})
];
But when I run home-manager build switch
, I get the error log
Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/a39621yq98k6rri5gz1icalarypl6r5w-source
source root is source
Executing cargoSetupPostUnpackHook
cp: cannot stat '/nix/store/kzgz9i0dvm7qmwf7jm7f55aqz1adxlwy-cargo-vendor-dir/Cargo.lock': No such file or directory
I’m not sure if home-manager is trying to access my cargoLock.lockFile
from the cargo build in the store? It already successfully downloaded all of my project’s dependencies, so it is definitely reading from the correct src
. I also have a shell.nix
and a “use nix” .envrc in the project directory:
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
buildInputs = with pkgs; [
rustup
];
packages = with pkgs; [
clang
gnumake
cmake
];
}
But I’m not sure if it’s being read or not (I would assume so because I don’t have rustup installed user or system-wide, I only use it in shells).
If anyone could help, I would really appreciate it. Thanks!