diff options
| author | seth <[email protected]> | 2024-01-24 01:56:28 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2024-01-24 05:35:36 -0500 |
| commit | 4967396702ad723d86a8d6792052cfdcad090ccf (patch) | |
| tree | a80f6184f3396b68e420c601e48d51b9027a8ec8 /default.nix | |
| parent | f91cb79249520f21b3ab5bc254607e00760179f9 (diff) | |
tree-wide: better support legacy nix
Diffstat (limited to 'default.nix')
| -rw-r--r-- | default.nix | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/default.nix b/default.nix index cb09ef8..8e74c61 100644 --- a/default.nix +++ b/default.nix @@ -1,6 +1,20 @@ -(import - (fetchTarball { - url = "https://github.com/edolstra/flake-compat/archive/35bb57c0c8d8b62bbfd284272c928ceb64ddbde9.tar.gz"; - sha256 = "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8="; - }) {src = ./.;}) -.defaultNix +let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + nixpkgs' = fetchTarball { + url = lock.nodes.nixpkgs.locked.url or "https://github.com/NixOS/nixpkgs/archive/${lock.nodes.nixpkgs.locked.rev}.tar.gz"; + sha256 = lock.nodes.nixpkgs.locked.narHash; + }; +in + { + nixpkgs ? + import nixpkgs' { + config = {}; + overlays = []; + inherit system; + }, + system ? builtins.currentSystem, + }: let + # fixed point wizardry + pkgs' = import ./overlay.nix (nixpkgs // pkgs') nixpkgs; + in + pkgs' |
