-
-
Notifications
You must be signed in to change notification settings - Fork 390
[nix] add a flake.nix
based on flakebox
.
#2212
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
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.
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,121 @@ | ||||||||||||||||||
{ | ||||||||||||||||||
description = "`gitoxide` compiled in a nix shell, using `crane` and `flakebox`."; | ||||||||||||||||||
|
||||||||||||||||||
inputs = { | ||||||||||||||||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-25.05"; | ||||||||||||||||||
flake-utils.url = "github:numtide/flake-utils"; | ||||||||||||||||||
|
||||||||||||||||||
fenix = { | ||||||||||||||||||
url = "github:nix-community/fenix"; | ||||||||||||||||||
inputs.nixpkgs.follows = "nixpkgs"; | ||||||||||||||||||
}; | ||||||||||||||||||
Comment on lines
+8
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not see this input used anywhere. It is not used as an argument in line 19, and I can't find any other changes that indicate it being used. What's going on?
Suggested change
|
||||||||||||||||||
flakebox = { | ||||||||||||||||||
url = "github:rustshop/flakebox"; | ||||||||||||||||||
inputs.nixpkgs.follows = "nixpkgs"; | ||||||||||||||||||
inputs.fenix.follows = "fenix"; | ||||||||||||||||||
}; | ||||||||||||||||||
}; | ||||||||||||||||||
|
||||||||||||||||||
outputs = { self, nixpkgs, flakebox, flake-utils, ... }: | ||||||||||||||||||
flake-utils.lib.eachDefaultSystem (arch: let | ||||||||||||||||||
pkgs = import nixpkgs { system = arch; }; | ||||||||||||||||||
flakeboxLib = flakebox.lib.mkLib pkgs { }; | ||||||||||||||||||
|
||||||||||||||||||
rustSrc = flakeboxLib.filterSubPaths { | ||||||||||||||||||
root = builtins.path { name = "gitoxide"; path = ./.; }; | ||||||||||||||||||
paths = [ "Cargo.toml" "Cargo.lock" ".cargo" | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I can see, there is no
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The list of paths is very long. How would this look like with a standard |
||||||||||||||||||
|
||||||||||||||||||
"etc" | ||||||||||||||||||
Comment on lines
+26
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strangely formatted. Could you use a formatter, like
Suggested change
|
||||||||||||||||||
"examples" | ||||||||||||||||||
"gitoxide-core" | ||||||||||||||||||
"gix" | ||||||||||||||||||
"gix-actor" | ||||||||||||||||||
"gix-archive" | ||||||||||||||||||
"gix-attributes" | ||||||||||||||||||
"gix-bitmap" | ||||||||||||||||||
"gix-blame" | ||||||||||||||||||
"gix-chunk" | ||||||||||||||||||
"gix-command" | ||||||||||||||||||
"gix-commitgraph" | ||||||||||||||||||
"gix-config" | ||||||||||||||||||
"gix-config-value" | ||||||||||||||||||
"gix-credentials" | ||||||||||||||||||
"gix-date" | ||||||||||||||||||
"gix-diff" | ||||||||||||||||||
"gix-dir" | ||||||||||||||||||
"gix-discover" | ||||||||||||||||||
"gix-features" | ||||||||||||||||||
"gix-fetchhead" | ||||||||||||||||||
"gix-filter" | ||||||||||||||||||
"gix-fs" | ||||||||||||||||||
"gix-fsck" | ||||||||||||||||||
"gix-glob" | ||||||||||||||||||
"gix-hash" | ||||||||||||||||||
"gix-hashtable" | ||||||||||||||||||
"gix-ignore" | ||||||||||||||||||
"gix-index" | ||||||||||||||||||
"gix-lfs" | ||||||||||||||||||
"gix-lock" | ||||||||||||||||||
"gix-macros" | ||||||||||||||||||
"gix-mailmap" | ||||||||||||||||||
"gix-merge" | ||||||||||||||||||
"gix-negotiate" | ||||||||||||||||||
"gix-note" | ||||||||||||||||||
"gix-object" | ||||||||||||||||||
"gix-odb" | ||||||||||||||||||
"gix-pack" | ||||||||||||||||||
"gix-packetline" | ||||||||||||||||||
"gix-packetline-blocking" | ||||||||||||||||||
"gix-path" | ||||||||||||||||||
"gix-pathspec" | ||||||||||||||||||
"gix-prompt" | ||||||||||||||||||
"gix-protocol" | ||||||||||||||||||
"gix-quote" | ||||||||||||||||||
"gix-rebase" | ||||||||||||||||||
"gix-ref" | ||||||||||||||||||
"gix-refspec" | ||||||||||||||||||
"gix-revision" | ||||||||||||||||||
"gix-revwalk" | ||||||||||||||||||
"gix-sec" | ||||||||||||||||||
"gix-sequencer" | ||||||||||||||||||
"gix-shallow" | ||||||||||||||||||
"gix-status" | ||||||||||||||||||
"gix-submodule" | ||||||||||||||||||
"gix-tempfile" | ||||||||||||||||||
"gix-tix" | ||||||||||||||||||
"gix-trace" | ||||||||||||||||||
"gix-transport" | ||||||||||||||||||
"gix-traverse" | ||||||||||||||||||
"gix-tui" | ||||||||||||||||||
"gix-url" | ||||||||||||||||||
"gix-utils" | ||||||||||||||||||
"gix-validate" | ||||||||||||||||||
"gix-worktree" | ||||||||||||||||||
"gix-worktree-state" | ||||||||||||||||||
"gix-worktree-stream" | ||||||||||||||||||
"src" | ||||||||||||||||||
"tests" | ||||||||||||||||||
|
||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
]; | ||||||||||||||||||
}; | ||||||||||||||||||
|
||||||||||||||||||
legacyPackages = (flakeboxLib.craneMultiBuild { }) (craneLib': let | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you say why you're planning to export |
||||||||||||||||||
craneLib = with pkgs; (craneLib'.overrideArgs { | ||||||||||||||||||
pname = "gitoxide"; | ||||||||||||||||||
src = rustSrc; | ||||||||||||||||||
buildInputs = [ openssl.dev ]; | ||||||||||||||||||
nativeBuildInputs = [ pkg-config ]; | ||||||||||||||||||
}); | ||||||||||||||||||
in rec { | ||||||||||||||||||
workspaceDeps = craneLib.buildWorkspaceDepsOnly { }; | ||||||||||||||||||
workspaceBuild = craneLib.buildWorkspace { cargoArtifacts = workspaceDeps; }; | ||||||||||||||||||
gitoxide = craneLib.buildPackage { }; | ||||||||||||||||||
}); | ||||||||||||||||||
in { | ||||||||||||||||||
inherit legacyPackages; | ||||||||||||||||||
packages.default = legacyPackages.gitoxide; | ||||||||||||||||||
devShells = flakeboxLib.mkShells { | ||||||||||||||||||
packages = [ ]; | ||||||||||||||||||
}; | ||||||||||||||||||
}); | ||||||||||||||||||
} |
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.
Which binaries does it build specifically?