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

Use new packages.${system}.default convention #195

Merged
merged 1 commit into from
Mar 18, 2024
Merged

Conversation

thkoch2001
Copy link
Contributor

The switch from defaultPackage to packages.${system}.default happened in NixOS/nix#5532.

Additionally I removed one layer:
self.nixosConfigurations.my-microvm.config.microvm.declaredRunner; self.nixosConfiguration.config.microvm.declaredRunner;

The latter should be easier to understand for new users.

@thkoch2001
Copy link
Contributor Author

Sorry, while waiting for the checks to pass I learned that nixosConfigurations is a predefined output for flakes and thus it might actually be confusing to have a nixosConfiguration (without plural s). On the other hand I don't believe that a microvm in nixosConfigurations is ever useful outside of the context of microvm?

The diff view can be simplified by surpressing whitespace diff.

@astro
Copy link
Owner

astro commented Jan 25, 2024

Happy to catch up with packages.${system}.default.

There is no nixosConfiguration in the Flakes schema, only nixosConfigurations, sorry.

source = "/nix/store";
mountPoint = "/nix/.ro-store";
} ];
nixosConfiguration = nixpkgs.lib.nixosSystem {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this right? Shouldn't it be nixosConfigurations.my-microvm = ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, yes. This PR needs changes.

@thkoch2001 Are you going to do that?

The switch from defaultPackage to packages.${system}.default happened in NixOS/nix#5532.
@thkoch2001
Copy link
Contributor Author

Sorry for the double-push. I reduced the commit now to the trivial one-line change.

In my own local flake however I removed nixosConfigurations entirely from the flake:

  outputs = { self, nixpkgs, microvm }:
    let
      system = "x86_64-linux";
      nixosConfiguration = nixpkgs.lib.nixosSystem {
          inherit system;
          modules = [
            microvm.nixosModules.microvm
[...]
        };
    in {
      packages.${system}.default = nixosConfiguration.config.microvm.declaredRunner;
    };

@astro astro merged commit 0e2223d into astro:main Mar 18, 2024
42 checks passed
@astro
Copy link
Owner

astro commented Mar 18, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants