Skip to content

Commit

Permalink
Bump flake lock and use rustPackage finalAttrs
Browse files Browse the repository at this point in the history
  • Loading branch information
RossSmyth committed Feb 27, 2025
1 parent bb2141c commit 4edfad0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 26 deletions.
22 changes: 3 additions & 19 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,36 +34,20 @@ in
# Currently rustPlatform.buildRustPackage doesn't have the finalAttrs pattern
# hooked up. To get around this while having good customization, mkDerivation is
# used instead.
stdenv.mkDerivation (self: {
rustPlatform.buildRustPackage (self: {
# START: Reevaluate the below attrs when
# https://github.com/NixOS/nixpkgs/pull/354999
# or
# https://github.com/NixOS/nixpkgs/pull/194475
# Are merged.

# TODO: Probably change to cargoLock
cargoDeps = rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
};
cargoLock.lockFile = ./Cargo.lock;

nativeBuildInputs = [
rustPlatform.rust.rustc # TODO: Remove
rustPlatform.rust.cargo # TODO: Remove
pkgs.installShellFiles
pkgs.git
];

# TODO: Remove entire attr
buildInputs = with rustPlatform; [
cargoSetupHook
cargoBuildHook
cargoInstallHook
];

# Use Helix's opt profile for the build.
# TODO: s/cargoBuildType/buildType
cargoBuildType = "release";
# END: Funny attrs to reevaluate
buildType = "release";

name = with builtins; (fromTOML (readFile ./helix-term/Cargo.toml)).package.name;
src = fs.toSource {
Expand Down
12 changes: 6 additions & 6 deletions flake.lock

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

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
};

checks.helix = self.outputs.packages.${system}.helix.override {
cargoBuildType = "debug";
buildType = "debug";
rustPlatform = msrvPlatform;
};

Expand Down

0 comments on commit 4edfad0

Please sign in to comment.