From 8ceec64be09fb0ec3530e52a5a9c35b14ce76377 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Thu, 3 Jun 2021 22:37:14 +0300 Subject: [PATCH] Use overlaid pkgs on old nix --- compat/default.nix | 1 + default.nix | 9 +++++++++ modules/nix.nix | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 compat/default.nix create mode 100644 default.nix diff --git a/compat/default.nix b/compat/default.nix new file mode 100644 index 0000000..9f77e85 --- /dev/null +++ b/compat/default.nix @@ -0,0 +1 @@ +{ ... }: (builtins.getFlake (toString ../.)).legacyPackages.${builtins.currentSystem} diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..95f7513 --- /dev/null +++ b/default.nix @@ -0,0 +1,9 @@ +{ ... }: +let + self = (import (let lock = builtins.fromJSON (builtins.readFile ./flake.lock); + in fetchTarball { + url = + "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; + }) { src = ./.; }).defaultNix; +in self // self.legacyPackages.${builtins.currentSystem} diff --git a/modules/nix.nix b/modules/nix.nix index f1b4330..408a7e2 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -1,6 +1,6 @@ { lib, inputs, ... }: { nix = rec { - nixPath = lib.mkForce [ "nixpkgs=/etc/nixpkgs" ]; + nixPath = lib.mkForce [ "nixpkgs=/etc/self/compat" ]; binaryCaches = [ "https://cache.nixos.org" ]; registry.self.flake = inputs.self; @@ -23,4 +23,5 @@ requireSignedBinaryCaches = true; }; environment.etc.nixpkgs.source = inputs.nixpkgs; + environment.etc.self.source = inputs.self; }