-
Notifications
You must be signed in to change notification settings - Fork 14
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
WIP: Add Nix Flake support #867
Draft
demusdev
wants to merge
2
commits into
kamu-data:master
Choose a base branch
from
demusdev:feature/nix-flake
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
description = "Next-generation decentralized data lakehouse and a multi-party stream processing network"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
rust-overlay.url = "github:oxalica/rust-overlay"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
overlays = [ (import rust-overlay) ]; | ||
pkgs = import nixpkgs { | ||
inherit system overlays; | ||
}; | ||
darwinPkgs = [ | ||
pkgs.darwin.apple_sdk.frameworks.SystemConfiguration | ||
pkgs.darwin.apple_sdk.frameworks.CoreServices | ||
]; | ||
in | ||
{ | ||
devShells.default = with pkgs; mkShell { | ||
buildInputs = [ | ||
(rust-bin.fromRustupToolchainFile ./rust-toolchain) | ||
rust-analyzer | ||
jq | ||
kubo | ||
flatbuffers | ||
protobuf | ||
] ++ lib.optionals pkgs.stdenv.isDarwin darwinPkgs; | ||
|
||
shellHook = '' | ||
''; | ||
}; | ||
} | ||
); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
As a beginner NixOS user myself I'm pretty excited to see this ... but at the same time worried about pushing OS/package-manager-specific stuff into the repo root that will not be used (and therefore cannot be maintained) by the whole team.
On one hand, the ease of setup this offers for Nix users is pretty great - you can get all dev dependencies in seconds. It also guarantees that same exact versions of e.g.
flatbuffers
andprotobuf
are used, which is a real concern in our current setup.On the other hand, I question whether it's a good idea to have e.g.
kubo
in here as it may result in user having two versions ofkubo
(system-wide, and one in the flake). In my NixOS I have installed rust viarustup
and the rest of dependencies as my system packages and that seems to work OK.Will need to think on this a bit more. Perhaps having this flake just as a "best-effort support" feature would be valuable enough.
Thanks a lot for contributing this though!
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.
Thanks for the comments!
I don't think it would be a big harm to have flake in repo despite only a few people will using it. I definitely don't propose it as the only or the main way to setup dev env. My idea was to have a kind of automation of setup described in DEVELOPER.md, so new contributors could have (isolated) environment immediately. For instance, I like how I can fetch Helix code, enter
nix develop
shell and build it, and also have rust-analyzer available in my editor.But I understand that you as a maintainer want to be very careful with adding new things to the repo.
Anyway, I created this PR more as a starting point of discussion than something to be merged immediately.
I plan to push flake file to parent directory and continue extending it, so there will be something for start when you'll consider having flake in the repo.
Should I close this PR or keep it as a reminder?
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.
Let's keep this open for sure. I want to find time to test it and perhaps contribute too.
Would be cool to eventually use this to automate things like all the cargo plugins that we currently suggest to install manually.
Hopefully we'll get to a point where flakes can also be used in Github CI actions :)
But lots of things to figure out still. For example I'd like to avoid duplicating this flake into
kamu-node
repo and riskingflake.lock
files going out of sync and bloating the host system. Perhaps the right direction would be to have a "kamu-wide" flake that bring in Rust, Node JS for our Web UI etc.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.
I'm very new to nix and don't have an idea atm how to organise it better, but eager to experiment.
That would be perfect nix usage I believe.