forked from Deuxfleurs/garage
nix/common.nix: use pattern from nix-community/flake-compat
This is still a bit confusing, as normally the flake.defaultNix attrset gets exposed via a top-level default.nix, but at least it brings us closer to that.
This commit is contained in:
parent
5b1a3d9a2e
commit
b4714e563e
1 changed files with 12 additions and 9 deletions
|
@ -1,14 +1,17 @@
|
||||||
let
|
let
|
||||||
lock = builtins.fromJSON (builtins.readFile ../flake.lock);
|
lock = builtins.fromJSON (builtins.readFile ../flake.lock);
|
||||||
flakeCompatRev = lock.nodes.flake-compat.locked.rev;
|
|
||||||
flakeCompat = fetchTarball {
|
inherit (lock.nodes.flake-compat.locked) owner repo rev narHash;
|
||||||
url =
|
|
||||||
"https://github.com/edolstra/flake-compat/archive/${flakeCompatRev}.tar.gz";
|
flake-compat = fetchTarball {
|
||||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
|
||||||
|
sha256 = narHash;
|
||||||
};
|
};
|
||||||
flake = ((import flakeCompat) { src = ../.; }).defaultNix;
|
|
||||||
in rec {
|
flake = (import flake-compat { system = builtins.currentSystem; src = ../.; });
|
||||||
pkgsSrc = flake.inputs.nixpkgs;
|
in
|
||||||
cargo2nix = flake.inputs.cargo2nix;
|
rec {
|
||||||
|
pkgsSrc = flake.defaultNix.inputs.nixpkgs;
|
||||||
|
cargo2nix = flake.defaultNix.inputs.cargo2nix;
|
||||||
cargo2nixOverlay = cargo2nix.overlays.default;
|
cargo2nixOverlay = cargo2nix.overlays.default;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue