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

Fix GitHub actions & rework Flake #63

Merged
merged 1 commit into from
Mar 19, 2024
Merged

Fix GitHub actions & rework Flake #63

merged 1 commit into from
Mar 19, 2024

Conversation

9999years
Copy link
Member

No description provided.

@9999years 9999years added the patch A patch-level change (backwards-compatible bug fixes) label Mar 19, 2024
@9999years 9999years merged commit 4af1ad3 into main Mar 19, 2024
2 checks passed
@9999years 9999years deleted the fix-github-actions branch March 19, 2024 20:20
@spikespaz
Copy link
Contributor

spikespaz commented Mar 22, 2024

I have a few questions:

  1. Why did you export non-standard outputs pkgs and localPkgs?

  2. Why do you export two different derivations, one as nix-your-shell-from-overlay and another from localPkgs?

  3. Why do you apply the overlay for the former through pkgs.appendOverlays? Doesn't this cause a double-evaluation of nixpkgs?

  4. Why did you remove passthru.generate-config?

If you want to change anything due to these questions, don't; I am carefully preparing another PR similar to (but better than) #40, as I have learned more since.

@9999years
Copy link
Member Author

Why did you export non-standard outputs pkgs and localPkgs?

This the package sets be cached by the Nix eval cache, which only works on Flake outputs.

If I used localPkgs as the packages output directly, nix flake check would break because localPkgs contains non-derivation values:

error:
       … while checking flake output 'packages'
         at /nix/store/ddk4plqjcdxhrpgg02kims5cvcx0p07d-source/flake.nix:38:5:
           37|
           38|     packages = eachSystem (system: let
             |     ^
           39|       localPkgs = self.pkgs.${system}.callPackage ./nix/makePackages.nix {inherit inputs;};

       … while checking the derivation 'packages.aarch64-darwin.inputs'
         at /nix/store/ddk4plqjcdxhrpgg02kims5cvcx0p07d-source/nix/makePackages.nix:8:14:
            7|   self:
            8|     {inherit inputs;}
             |              ^
            9|     // (lib.packagesFromDirectoryRecursive {

       error: flake attribute 'packages.aarch64-darwin.inputs' is not a derivation

Why do you export two different derivations, one as nix-your-shell-from-overlay and another from localPkgs?

Just so I can check that the overlay builds correctly in CI.

Why do you apply the overlay for the former through pkgs.appendOverlays?

So the alternative here is to use the overlay when computing pkgs, like this:

makePkgs = system:
  import nixpkgs {
    localSystem = system;
    overlays = [ self.overlays.default ];
  };

...but then I can't set the packages output to the local packages, because the resulting package set doesn't distinguish between overlayed and base packages, and setting packages to the entire package set is non-viable (this is why nixpkgs uses `legacyPackages).

Why did you remove passthru.generate-config?

Accident, I'll fix that.

9999years added a commit that referenced this pull request Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch A patch-level change (backwards-compatible bug fixes)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants