Use Cargo.toml version in Nix package
This commit is contained in:
parent
18f457e56e
commit
bc92ad7f9f
|
@ -21,6 +21,7 @@
|
|||
|
||||
outputs = { self, nixpkgs, nix, ... }@inputs:
|
||||
let
|
||||
mncMeta = (builtins.fromTOML (builtins.readFile ./magic-nix-cache/Cargo.toml)).package;
|
||||
overlays = [ inputs.rust-overlay.overlays.default nix.overlays.default ];
|
||||
supportedSystems = [
|
||||
"aarch64-linux"
|
||||
|
@ -40,7 +41,9 @@
|
|||
in
|
||||
{
|
||||
packages = forEachSupportedSystem ({ pkgs, cranePkgs, ... }: rec {
|
||||
magic-nix-cache = pkgs.callPackage ./package.nix { };
|
||||
magic-nix-cache = pkgs.callPackage ./package.nix {
|
||||
inherit (mncMeta) version;
|
||||
};
|
||||
#inherit (cranePkgs) magic-nix-cache;
|
||||
default = magic-nix-cache;
|
||||
});
|
||||
|
|
13
package.nix
13
package.nix
|
@ -1,4 +1,6 @@
|
|||
{ lib, stdenv, rustPlatform
|
||||
{ lib
|
||||
, stdenv
|
||||
, rustPlatform
|
||||
, pkg-config
|
||||
, installShellFiles
|
||||
, nix
|
||||
|
@ -7,14 +9,16 @@
|
|||
, rust-analyzer
|
||||
, clippy
|
||||
, rustfmt
|
||||
, version
|
||||
}:
|
||||
|
||||
let
|
||||
ignoredPaths = [ ".github" "target" "book" ];
|
||||
|
||||
in rustPlatform.buildRustPackage rec {
|
||||
in
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "magic-nix-cache";
|
||||
version = "0.1.0";
|
||||
inherit version;
|
||||
|
||||
src = lib.cleanSourceWith {
|
||||
filter = name: type: !(type == "directory" && builtins.elem (baseNameOf name) ignoredPaths);
|
||||
|
@ -30,7 +34,8 @@ in rustPlatform.buildRustPackage rec {
|
|||
];
|
||||
|
||||
buildInputs = [
|
||||
nix boost
|
||||
nix
|
||||
boost
|
||||
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
|
||||
SystemConfiguration
|
||||
]);
|
||||
|
|
Loading…
Reference in a new issue