Skip to content

Commit

Permalink
Merge pull request #295 from tmuehlbacher/flake-stuff
Browse files Browse the repository at this point in the history
Make nix package builds have a unique version; dev shell addition
  • Loading branch information
koverstreet committed Jun 10, 2024
2 parents e743caf + 2a15fc0 commit 786e507
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@

craneLib = crane.mkLib pkgs;

libbcachefsCommit = substring 0 7 (builtins.readFile ./.bcachefs_revision);
rev = self.shortRev or self.dirtyShortRev or (substring 0 8 self.lastModifiedDate);
makefileVersion = removePrefix "VERSION=" (
findFirst (line: hasPrefix "VERSION=" line) "VERSION=0.0.0" (split "\n" (readFile ./Makefile))
);
version = "${makefileVersion}+git-${libbcachefsCommit}";
version = "${makefileVersion}+${rev}";

commonArgs = {
inherit version;
Expand Down Expand Up @@ -174,6 +174,7 @@
# development, and might need to be version matched with build
# dependencies (e.g. clippy or rust-analyzer).
packages = with pkgs; [
bear
cargo-audit
cargo-outdated
clang-tools
Expand Down

0 comments on commit 786e507

Please sign in to comment.