From 2c2781805f6e86e769f2d01b3e8fee5bed662a1d Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Sat, 9 Mar 2024 12:27:10 -0500 Subject: [PATCH] Use nixpkgs version from flake by default When not using flakes, you would immediately start using the latest version of the nix-ros branch whenever I updated it, even if it hadn't been tested or added to the cache yet. Now, it will match the flake locked version by default even when not using flakes. --- default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/default.nix b/default.nix index 6f3922414d..c8be439d85 100644 --- a/default.nix +++ b/default.nix @@ -1,4 +1,11 @@ -{ nixpkgs ? builtins.fetchTarball "https://github.com/lopsided98/nixpkgs/archive/nix-ros.tar.gz" +let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + lockedNixpkgs = builtins.fetchTarball { + url = "https://github.com/lopsided98/nixpkgs/archive/${lock.nodes.nixpkgs.locked.rev}.tar.gz"; + sha256 = lock.nodes.nixpkgs.locked.narHash; + }; +in +{ nixpkgs ? lockedNixpkgs , overlays ? [] , ... }@args: