diff --git a/default.nix b/default.nix index 6466507b7..535b3fa07 100644 --- a/default.nix +++ b/default.nix @@ -1,9 +1,15 @@ -(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 +let + lockFile = builtins.fromJSON (builtins.readFile ./flake.lock); + flake-compat-node = lockFile.nodes.${lockFile.nodes.root.inputs.flake-compat}; + flake-compat = builtins.fetchTarball { + inherit (flake-compat-node.locked) url; + sha256 = flake-compat-node.locked.narHash; + }; + + flake = ( + import flake-compat { + src = ./.; + } + ); +in +flake.defaultNix diff --git a/flake.lock b/flake.lock index b5060b61c..942c78bd2 100644 --- a/flake.lock +++ b/flake.lock @@ -3,17 +3,15 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" + "lastModified": 1751685974, + "narHash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=", + "rev": "549f2762aebeff29a2e5ece7a7dc0f955281a1d1", + "type": "tarball", + "url": "https://git.lix.systems/api/v1/repos/lix-project/flake-compat/archive/549f2762aebeff29a2e5ece7a7dc0f955281a1d1.tar.gz" }, "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" + "type": "tarball", + "url": "https://git.lix.systems/lix-project/flake-compat/archive/main.tar.gz" } }, "lowdown-src": { diff --git a/flake.nix b/flake.nix index 867f0c9c7..0a661b623 100644 --- a/flake.nix +++ b/flake.nix @@ -24,7 +24,7 @@ flake = false; }; flake-compat = { - url = "github:edolstra/flake-compat"; + url = "https://git.lix.systems/lix-project/flake-compat/archive/main.tar.gz"; flake = false; }; }; diff --git a/shell.nix b/shell.nix index 99c521865..cbf39f10e 100644 --- a/shell.nix +++ b/shell.nix @@ -1,9 +1,15 @@ let - lock = builtins.fromJSON (builtins.readFile ./flake.lock); - shell = - (import (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 = ./.; }).shellNix; + lockFile = builtins.fromJSON (builtins.readFile ./flake.lock); + flake-compat-node = lockFile.nodes.${lockFile.nodes.root.inputs.flake-compat}; + flake-compat = builtins.fetchTarball { + inherit (flake-compat-node.locked) url; + sha256 = flake-compat-node.locked.narHash; + }; + + flake = ( + import flake-compat { + src = ./.; + } + ); in -shell.default // shell.devShells.${builtins.currentSystem} +flake.shellNix