Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git submodule integration #2

Open
Georges760 opened this issue Sep 6, 2024 · 3 comments
Open

git submodule integration #2

Georges760 opened this issue Sep 6, 2024 · 3 comments

Comments

@Georges760
Copy link

Georges760 commented Sep 6, 2024

Excellent job, it works on my machine too !!!

I had a couple of elf patching error but at the end I can compile....

I wonder how could we use your git repo as a esp-hal cargo project using git submodule maybe ?

If you flatten all files in the root of your repo, it could be used as a submodule just by creating a symlink to shell.nix from the root of the host repo (I guess).

@leighleighleigh
Copy link
Owner

That is great to hear! :) I also get ELF-patching warnings, it seems OK.

I haven't tried to package it as a submodule before, but if you are just looking for a 'portable' shell.nix you can use this one :) (this is the one I normally use).

{ pkgs ? import <nixpkgs> {}}:
let 
    esp-rs-src = builtins.fetchTarball "https://github.com/leighleighleigh/esp-rs-nix/archive/master.tar.gz";
    esp-rs = pkgs.callPackage "${esp-rs-src}/esp-rs/default.nix" {};
in
pkgs.mkShell rec {
    name = "esp-rs-nix";

    buildInputs = [
        esp-rs
        pkgs.rustup # I can't remember why I needed this 
        #pkgs.espflash # broken, install with cargo instead!
        pkgs.rust-analyzer
        pkgs.pkg-config 
        pkgs.stdenv.cc 
        pkgs.systemdMinimal
    ];

    shellHook = ''
    # optionally reload your bashrc to make the ugly nix-shell prompt go away 
    #. ~/.bashrc

    # this is important - it tells rustup where to find the esp toolchain,
    # without needing to copy it into your local ~/.rustup/ folder.
    export RUSTUP_TOOLCHAIN=${esp-rs}
    '';
}

@Georges760
Copy link
Author

thanks I like your shell.nix example ! may i ask where are you using it ?

@leighleighleigh
Copy link
Owner

I haven't got a public repo that uses it at the moment - but I've got several commercial projects using embassy-rs, which use a shell.nix file like that :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants