-
Notifications
You must be signed in to change notification settings - Fork 6
chore: switch to crate2nix #2719
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: master
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { inputs, ... }: | ||
| { | ||
| perSystem = _: { | ||
| nixpkgs.overlays = [ | ||
| (_: prev: { | ||
| crate2nixTools = prev.callPackage "${inputs.crate2nix}/tools.nix" { }; | ||
| }) | ||
| ]; | ||
| }; | ||
| } |
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 |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| final: prev: { | ||
| statix-cargo-nix = prev.callPackage ./packages/cargo-nix.nix { }; | ||
| statix = prev.callPackage ./packages/statix.nix { }; | ||
| statix-workspace = prev.callPackage ./packages/statix-workspace.nix { }; | ||
| statix-vim = prev.callPackage ./packages/statix-vim.nix { }; | ||
|
Comment on lines
+2
to
5
Member
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. Does exposing these two new intermediate packages provide any value to developers or users? Should they exist as local binding in
Author
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. Neither of these has value outside of being inputs to building |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| lib, | ||
| crate2nixTools, | ||
| }: | ||
| crate2nixTools.generatedCargoNix { | ||
| name = "statix"; | ||
| src = lib.fileset.toSource { | ||
| root = ../.; | ||
| fileset = lib.fileset.unions [ | ||
| (lib.fileset.fileFilter ( | ||
| file: | ||
| lib.any lib.id [ | ||
| (file.name == "Cargo.toml") | ||
| (file.hasExt "rs") | ||
| (file.hasExt "snap") | ||
| ] | ||
| ) ../.) | ||
| ../Cargo.lock | ||
| ../insta.yaml | ||
| ]; | ||
| }; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| callPackage, | ||
| statix-cargo-nix, | ||
| }: | ||
| callPackage statix-cargo-nix { } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,44 +1,25 @@ | ||
| { | ||
| rustPlatform, | ||
| lib, | ||
| clippy, | ||
| callPackage, | ||
| defaultCrateOverrides, | ||
| statix-cargo-nix, | ||
| }: | ||
| rustPlatform.buildRustPackage { | ||
| pname = "statix"; | ||
| version = "0.6.0-git"; | ||
| src = lib.fileset.toSource { | ||
| root = ../.; | ||
| fileset = lib.fileset.unions [ | ||
| (lib.fileset.fileFilter ( | ||
| file: | ||
| lib.any lib.id [ | ||
| (file.name == "Cargo.toml") | ||
| (file.hasExt "rs") | ||
| (file.hasExt "snap") | ||
| ] | ||
| ) ../.) | ||
| ../Cargo.lock | ||
| ../insta.yaml | ||
| ]; | ||
| let | ||
| built = (callPackage statix-cargo-nix { }).workspaceMembers.statix.build.override { | ||
| runTests = true; | ||
| crateOverrides = defaultCrateOverrides // { | ||
| statix = _: { | ||
| useClippy = true; | ||
| RUSTFLAGS = "-D warnings"; | ||
|
Member
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. Should this be achieved using
Author
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 am not aware |
||
| }; | ||
| }; | ||
| }; | ||
| RUSTFLAGS = "-D warnings"; | ||
|
mightyiam marked this conversation as resolved.
|
||
|
|
||
| nativeBuildInputs = [ clippy ]; | ||
|
|
||
| checkPhase = '' | ||
| runHook preCheck | ||
|
|
||
| cargo clippy --all-targets --all-features | ||
| cargoCheckHook | ||
|
|
||
| runHook postCheck | ||
| ''; | ||
|
|
||
| cargoLock.lockFile = ../Cargo.lock; | ||
| in | ||
| built.overrideAttrs (_: { | ||
| meta = { | ||
| mainProgram = "statix"; | ||
| description = "Lints and suggestions for the Nix programming language"; | ||
| homepage = "https://github.com/molybdenumsoftware/statix"; | ||
| license = lib.licenses.mit; | ||
| }; | ||
| } | ||
| }) | ||
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.
Please review your changes as best as you can before expecting anyone else to review them. Such trivial mistakes can be avoided.
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.
Understood. I should have caught that before pushing. I'll be more careful.
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.
This unrelated and undesireable change is still present.