Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Generated by Cargo
# will have compiled files and executables
target/
/result

# repositories used for local testing
/tests/fixtures/repos
Expand Down
255 changes: 255 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

121 changes: 121 additions & 0 deletions flake.nix
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`.";
Copy link
Member

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?


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
Copy link
Contributor

Choose a reason for hiding this comment

The 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
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can see, there is no .cargo file or directory in this repository. So filtering for it is confusing. Probably remove it?

Suggested change
paths = [ "Cargo.toml" "Cargo.lock" ".cargo"
paths = [ "Cargo.toml" "Cargo.lock"

Copy link
Contributor

Choose a reason for hiding this comment

The 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 craneLib filter and exclusions?


"etc"
Comment on lines +26 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strangely formatted. Could you use a formatter, like alejandra or nixpkgs-fmt?

Suggested change
paths = [ "Cargo.toml" "Cargo.lock" ".cargo"
"etc"
paths = [
"Cargo.toml"
"Cargo.lock"
".cargo"
"etc"

"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"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

];
};

legacyPackages = (flakeboxLib.craneMultiBuild { }) (craneLib': let
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you say why you're planning to export legacyPackages? What's the motivation here for this non-standard output?

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 = [ ];
};
});
}
Loading