default.nix: init
Move recipes from flake.nix:s `packages` to a `callPackage`-able scope.nix. This way out-of-tree projects can reuse the `buildRustPackage` definitions (e.g. the in-sync `cargoLock` hashes) without depending on the unsupported flakes feature.
This commit is contained in:
parent
c42eaef554
commit
cbce1ae3a2
4 changed files with 87 additions and 25 deletions
22
default.nix
Normal file
22
default.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
let
|
||||
lockFile = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||
flake-compat-node = lockFile.nodes.${lockFile.nodes.root.inputs.flake-compat};
|
||||
flake-compat = builtins.fetchTarball {
|
||||
inherit (flake-compat-node.locked) url;
|
||||
sha256 = flake-compat-node.locked.narHash;
|
||||
};
|
||||
|
||||
flake' = (
|
||||
import flake-compat {
|
||||
src = ./.;
|
||||
}
|
||||
);
|
||||
flake = flake'.defaultNix;
|
||||
in
|
||||
{
|
||||
useFlake ? true,
|
||||
nixpkgs ? if useFlake then flake.inputs.nixpkgs else <nixpkgs>,
|
||||
pkgs ? import nixpkgs { },
|
||||
}:
|
||||
|
||||
pkgs.callPackage ./scope.nix { }
|
||||
Loading…
Add table
Add a link
Reference in a new issue