-
Notifications
You must be signed in to change notification settings - Fork 10
feat: add nix flake package and dev-shell #24
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThis pull request introduces a new Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
flake.nix (3)
33-42: Tighten GStreamer plugin set and GST_PLUGIN_PATH compositionA few suggestions to make the GStreamer side more predictable and minimal:
- You currently mix
makeSearchPath "lib/gstreamer-1.0"(good for plugin dirs) withmakeLibraryPath(generallibdirs) insideGST_PLUGIN_PATH_1_0. For clarity, it’s usually better to keepGST_PLUGIN_PATH_1_0to actual plugin directories only and rely onLD_LIBRARY_PATH/ Nix’s default forlibdirectories. For example:- gstPluginPath = nixpkgs.lib.makeSearchPath "lib/gstreamer-1.0" gstreamerSearch + ":" + nixpkgs.lib.makeLibraryPath gstreamerLib;
- gstPluginPath = nixpkgs.lib.makeSearchPath "lib/gstreamer-1.0" (gstreamerLib ++ gstreamerSearch);
- If the goal is “include almost all plugins”, consider also adding the plugin packages used in `gstreamerLib` to `shell-deps` for better symmetry and to make it obvious which plugin sets are actually on the system path. - If you only need a subset of plugins for hang-gst development, you might want to trim `gstreamerSearch` down later to speed up registry scans and reduce conflicts. These are behavioral tweaks rather than blockers but will make the shell easier to reason about. Also applies to: 44-55, 61-64 --- `57-70`: **Consider exposing the dev shell as `devShells.default` for better `nix develop` UX** Right now you expose a single `devShell` attribute per system: ```nix devShell = pkgs.mkShell { ... };Modern Nix and flake tooling typically expect
devShells.${system}.default. Withflake-utils.lib.eachDefaultSystemthis usually looks like:- devShell = pkgs.mkShell { + devShells.default = pkgs.mkShell { packages = shell-deps; env = { ... }; };This makes it clearer for users (
nix develop/nix develop .#default) and aligns with common templates; it also avoids edge cases across Nix versions and frontends.
72-83: Double‑check native vs build inputs for thehang-gstpackageThe
hang-gstpackage wiring viacraneLib.buildPackagelooks generally good, but the build inputs deserve a quick check:nativeBuildInputs = with pkgs; [ pkg-config glib glib.dev gst_all_1.gstreamer.dev ];For Rust crates linking against C libraries via
pkg-config, it’s common to:
- Put tools like
pkg-configinnativeBuildInputs.- Put the actual libraries (
glib,gst_all_1.gstreamer, etc.) inbuildInputsso they end up in the link environment for the target.Having everything in
nativeBuildInputsmay still work on some platforms but can be fragile, especially for cross‑compilation or non-Linux targets.I’d recommend splitting these along tool vs library lines and adding any additional GStreamer dev outputs you actually need (e.g.
gst_all_1.gstreamer,gst_all_1.gst-plugins-base.dev) once you’ve run a full build in the flake.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
flake.lockis excluded by!**/*.lock
📒 Files selected for processing (1)
flake.nix(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-10-06T17:21:39.335Z
Learnt from: CR
Repo: kixelated/hang-gst PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-10-06T17:21:39.335Z
Learning: Applies to src/lib.rs : In src/lib.rs, register the GStreamer plugin as "hang" and register both elements: hangsink and hangsrc
Applied to files:
flake.nix
📚 Learning: 2025-10-06T17:21:39.335Z
Learnt from: CR
Repo: kixelated/hang-gst PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-10-06T17:21:39.335Z
Learning: Applies to src/sink/mod.rs : Place the HangSink GStreamer element wrapper in src/sink/mod.rs
Applied to files:
flake.nix
🔇 Additional comments (3)
flake.nix (3)
1-12: Overall flake structure and inputs look solidThe high-level flake shape (description, inputs, use of
flake-utils,crane, andrust-overlay) is coherent and follows common patterns. Usingnixos-unstableplus a flake lock for reproducibility should be fine for this project.
18-31: Rust toolchain and crane integration are correctly wiredThe
pkgsimport withrust-overlay, therust-toolchainoverride withrust-srcandrust-analyzer, andcraneLib = (crane.mkLib pkgs).overrideToolchain rust-toolchainare all consistent with typical crane setups. ThecrateInfohelper aroundcrateNameFromCargoTomlis also a reasonable abstraction.
72-86: Good default package selectionExposing
packages.hang-gstand wiringpackages.default = self.packages.${system}.hang-gst;is a nice touch; it makesnix buildandnix build .#hang-gstboth do the intuitive thing.
|
Oh whoops I forgot to port this over. Here's the commit that removed the gstreamer stuff if you want to compare notes: moq-dev/moq@ad1ccce |
|
And yeah, I think Coderabbit's nitpick comments are right? The library path stuff might be unnecessary. |
this is an inital attempt at creating a dev-shell for this. i am unsure if all dependencies are present.
I've included (almost) all gstreamer plugins, so its easier to test pipelines, but i'm also unsure if this is needed.
this will also conflict with gstreamer installed e.g. via homebrew (tested on macos), my short solution to this was to uninstall the version from homebrew
Summary by CodeRabbit