aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-07-16 12:47:04 +0300
committerFlorian Klink <flokli@flokli.de>2023-07-16 12:52:14 +0300
commit79ca8e76a43e8df527c68b00ebc10eaceef9daaa (patch)
tree2425b6ef61290307625c85592610e86f16670127
parent1bbf604224abed2ce9fe1d8fb970b20d26a13f3a (diff)
downloadgarage-79ca8e76a43e8df527c68b00ebc10eaceef9daaa.tar.gz
garage-79ca8e76a43e8df527c68b00ebc10eaceef9daaa.zip
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.
-rw-r--r--nix/common.nix21
1 files changed, 12 insertions, 9 deletions
diff --git a/nix/common.nix b/nix/common.nix
index acc5ce7e..323c3882 100644
--- a/nix/common.nix
+++ b/nix/common.nix
@@ -1,14 +1,17 @@
let
lock = builtins.fromJSON (builtins.readFile ../flake.lock);
- flakeCompatRev = lock.nodes.flake-compat.locked.rev;
- flakeCompat = fetchTarball {
- url =
- "https://github.com/edolstra/flake-compat/archive/${flakeCompatRev}.tar.gz";
- sha256 = lock.nodes.flake-compat.locked.narHash;
+
+ inherit (lock.nodes.flake-compat.locked) owner repo rev narHash;
+
+ flake-compat = fetchTarball {
+ url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
+ sha256 = narHash;
};
- flake = ((import flakeCompat) { src = ../.; }).defaultNix;
-in rec {
- pkgsSrc = flake.inputs.nixpkgs;
- cargo2nix = flake.inputs.cargo2nix;
+
+ flake = (import flake-compat { system = builtins.currentSystem; src = ../.; });
+in
+rec {
+ pkgsSrc = flake.defaultNix.inputs.nixpkgs;
+ cargo2nix = flake.defaultNix.inputs.cargo2nix;
cargo2nixOverlay = cargo2nix.overlays.default;
}