mikedilger / gossip

Gossip is a nostr client
Other
718 stars 83 forks source link

New nix flake for development purposes #920

Open majje opened 1 day ago

majje commented 1 day ago

Hi Mike

I tried to use the flake.nix in your repository but it didn't help me to setup a development shell. Your flake is probably used to create a nix package and it is using an nixos-23.11, and it failed with:

error: builder for '/nix/store/ai0fpifmgf8f5g3mbjw2q9wy5sglpgv1-windows-core-0.57.0.drv' failed with exit code 1;
       last 7 log lines:
       >
       > trying https://static.crates.io/crates/windows-core/0.57.0/download
       >   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
       >                                  Dload  Upload   Total   Spent    Left  Speed
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (7) Failed to connect to static.crates.io port 443 after 166 ms: Couldn't connect to server
       > error: cannot download windows-core-0.57.0 from any mirror
       For full logs, run 'nix log /nix/store/ai0fpifmgf8f5g3mbjw2q9wy5sglpgv1-windows-core-0.57.0.drv'.

My flake should probably be mixed with the original flake, without breaking any existing functionality, but I'm no nix/nixos expert, so I just don't know how :-( Before merging, at least have some nix expertise looking at it... (Maybe @Kodylow can have a look)

I got inspiration from https://drakerossman.com/blog/rust-development-on-nixos-bootstrapping-rust-nightly-via-flake

To build and run:

nix develop   # enter development shell
cargo build
./target/debug/gossip

Thanx for a great nostr client!

mikedilger commented 22 hours ago

I did not create the flake file in the gossip repo, and I had half a mind to not allow it because I have no way to verify that it even makes sense or perhaps contains hacks or something (I don't believe it does, but I can't vouch for it).

majje commented 22 hours ago

I totally understand! It was just useful to me and wanted to share. Actually, I almost wrote that my pull request probably should not be merged ;-P

(Hopefully someday I understand how to update this https://github.com/NixOS/nixpkgs/blob/nixos-24.05/pkgs/by-name/go/gossip/package.nix)

Close it! Thanx!

mikedilger commented 21 hours ago

Id prefer if you and @Kodylow came up with a flake file that works for both of you and I'll merge it... since we already have a flake file and it sounds like it might be wrong.