Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nix flake check IFD issue using nixbuild.net with haskell.nix to generate build artifacts #1711

Open
ParetoOptimalDev opened this issue Sep 26, 2022 · 3 comments
Labels
preserved Keep stale bot away

Comments

@ParetoOptimalDev
Copy link

I plan to update this issue with more context, but basically my goal was to use the nixbuild.net remote builder to generate and backup build artifacts to cachix for aarch64-linux and aarch64-darwin daily.

The issue is that nixbuild.net runs nix flake check and my first roadblock was because of IFD's and nix flake check not working well (related: #1097 and NixOS/nix#4265).

I tried to disable checks since they aren't explicitly necessary for this here, but perhaps I just did that wrong and need to explore more here.

Ideally I'd be able to get the checks to work though, since in my future projects soon I will want to use nix flake check and have a working nix flake show.

Perhaps this comment about makign IFDs compatible with nix-flake check haskell.nix can generally fix nix flake show with the information posted recently in this comment. Here's a snippet from that comment:

This is not entirely true. nix flake show only evaluates a few attributes of the derivation (name, type) in order to list it. Therefore the issue can be fixed by constructing a derivation which does not draw name and type from an IFD operation.

Finally here is my repo attempting this:

https://github.com/ParetoOptimalDev/test-haskell-nix-template/

Here are the github actions failures which have the commits linked showing changes I tried from workarounds in linked issues:

https://github.com/ParetoOptimalDev/test-haskell-nix-template/actions

@L-as
Copy link
Contributor

L-as commented Sep 27, 2022

A cheap trick is to create a wrapper flake essentially:

let
  oldFlake = ...;
   
   supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
   perSystem = nixpkgs.lib.genAttrs supportedSystems;
in {
  packages = perSystem (system: {
    default = oldFlake.packages.${system}.default;
    "mylib:lib:mylib" = oldFlake.packages.${system}."mylib:lib:mylib";
  });
  
  # ...
}

@hamishmack
Copy link
Collaborator

Finally here is my repo attempting this:

https://github.com/ParetoOptimalDev/test-haskell-nix-template/

Is that repo public? I get a 404 error.

@ParetoOptimalDev
Copy link
Author

@hamishmack Doh! It was private, just made it public.

@hamishmack hamishmack added the preserved Keep stale bot away label Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preserved Keep stale bot away
Projects
None yet
Development

No branches or pull requests

3 participants