Use overlaid pkgs on old nix

This commit is contained in:
Alexander Bantyev 2021-06-03 22:37:14 +03:00
parent d74a9ca049
commit 8ceec64be0
Signed by: balsoft
GPG Key ID: E081FF12ADCB4AD5
3 changed files with 12 additions and 1 deletions

1
compat/default.nix Normal file
View File

@ -0,0 +1 @@
{ ... }: (builtins.getFlake (toString ../.)).legacyPackages.${builtins.currentSystem}

9
default.nix Normal file
View File

@ -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}

View File

@ -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;
}