Conversation
|
For the non nix enlightened can you:
|
| export CRATES_TUI_DATA_HOME=$(pwd)/.data | ||
| export CRATES_TUI_LOG_LEVEL=DEBUG | ||
|
|
||
| use flake |
There was a problem hiding this comment.
For direnv users who use nix + flakes: This will auto-load the dev-shell for you if you cd into the project.
| inputs = { | ||
| nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
| rust-overlay.url = "github:oxalica/rust-overlay"; | ||
| flake-parts.url = "github:hercules-ci/flake-parts"; | ||
| cargo-watchdoc.url = "github:ModProg/cargo-watchdoc"; | ||
| }; |
There was a problem hiding this comment.
nixpkgswell contains all available nix-packages which we need, especially the dependencies.rust-overlayis basically a toolset for nix to, for example, fetch the latest stable toolchain of rust, whilenixpkgsisn't that fastflake-partsprovides a better API to write aflake.nixcargo-watchdoc: I personally think that this is kinda useful andnixpkgshasn't packaged this one yet, so this github link is referring to the official repo to include it into a dev shell
| apps.default = { | ||
| type = "app"; | ||
| program = self'.packages.default; | ||
| }; |
There was a problem hiding this comment.
This allows nix users to just run nix run and crates-tui will run without installing it.
| program = self'.packages.default; | ||
| }; | ||
|
|
||
| packages.default = pkgs.callPackage (import ./nix/package.nix) { }; |
There was a problem hiding this comment.
This line declares a package, provided by this repository (here: crates-tui).
| devShells.default = | ||
| let | ||
| rust-toolchain = (pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override { | ||
| extensions = [ "rust-src" "rust-analyzer" ]; | ||
| }; | ||
| in | ||
| pkgs.mkShell { | ||
| packages = with pkgs; [ | ||
| pkg-config | ||
| openssl | ||
| ] ++ [ rust-toolchain inputs.cargo-watchdoc.packages.${system}.default ]; | ||
| }; | ||
| }; | ||
| }; |
There was a problem hiding this comment.
This one declares the dev shell with all required dependencies to just run cargo run or cargo build.
|
@joshka I hope my comments are clearing up some things, if not, feel free to ask :) |
|
Thanks for the PR! I like the idea of adding nix support in theory. I personally cannot use nix on a work computer because it requires root access so I've avoided it for maintaining a setup for works across multiple machines.
|
Well, I don't mind if it gets removed (of course it would be nice if it stays there ;))
Basically nothing I think. Because I've "included" the meta-data from the crate into the flake. So whenever you change anything to
Aye! I wouldn't mind to get the questions |
|
Revisiting this, my main question needs a bit more detail. I don't currently understand (as someone not well versed in nix) what value adding this has. Can you expand on that perhaps? What are you looking to achieve here? |
Sure thing! So the main achievements which I'm looking for are:
I hope this clears up some questions. |

A wild pikachu appeared.
Hi! This PR adds a
flake.nixwith a dev-shell and a package so that nix users are able to use a "nightly" version ofcrates-tui.