Fix pure evaluation mode #25

Open
opened 2021-08-19 13:44:41 +00:00 by shlevy · 1 comment
shlevy commented 2021-08-19 13:44:41 +00:00 (Migrated from github.com)

Currently flake-compat fails in pure evaluation mode, due to the rootSrc cleaning. I suspect we could just add another conditional to 12c64ca55c/default.nix (L104) to not tryFetchGet when not builtins ? currentSystem

Currently flake-compat fails in pure evaluation mode, due to the `rootSrc` cleaning. I suspect we could just add another conditional to https://github.com/edolstra/flake-compat/blob/12c64ca55c1014cdc1b16ed5a804aa8576601ff2/default.nix#L104 to not `tryFetchGet` when not `builtins ? currentSystem`
pnmadelaine commented 2023-11-23 12:03:14 +00:00 (Migrated from github.com)

In my flakes I started using the following default.nix to avoid this issue:

(
  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 =
      if builtins ? currentSystem
      then ./.
      else "${./.}";
  }
)
.defaultNix
In my flakes I started using the following `default.nix` to avoid this issue: ``` ( 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 = if builtins ? currentSystem then ./. else "${./.}"; } ) .defaultNix ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/flake-compat#25
No description provided.