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

Remove customBuilds, nixos-generate has --flake #436

Merged
merged 1 commit into from
Apr 1, 2022

Conversation

Pacman99
Copy link
Member

@Pacman99 Pacman99 commented Feb 26, 2022

nixos-generators now has --flake support, so theres no reason for us to export all the builds here. Lets just offload this responsibility to nixos-generators.

Somewhat blocked by nix-community/nixos-generators#138, so that we don't need to make our hosts overridable.

@blaggacao blaggacao mentioned this pull request Feb 27, 2022
@montchr
Copy link
Collaborator

montchr commented Feb 27, 2022

Nice. I had to work around customBuilds in the darwin-support branch since it's not usable on darwin hosts. I was going to propose via that branch that we make the module optional or loaded only for Linux hosts, but offloading it to nixos-generators is even better.

@Pacman99 Pacman99 force-pushed the remove-customBuilds branch 2 times, most recently from 44b7866 to 7769225 Compare February 28, 2022 02:45
@Pacman99 Pacman99 changed the title remove customBuilds in favor of nixos-generators Remove customBuilds, nixos-generate has --flake Feb 28, 2022
Copy link
Collaborator

@montchr montchr left a comment

Choose a reason for hiding this comment

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

🏗️

@danielphan2003
Copy link

I used to use bud to generate ISOs for my configs, but now that nix-community/nixos-generators#138 just closed, how do I use nixos-generate with this?

I'm using this PR and the latest commit of nixos-generators. I used nixos-generate -f iso --system x86_64-linux --flake .\#rog-bootstrap but it throws attribute 'extendModules' missing'. Does this have anything to do with the old bud behavior (see https://github.com/divnix/bud/blob/a789d710851441ba7e7cd59be378623b1fe05688/scripts/hosts-build.bash)?

@Pacman99 Pacman99 force-pushed the remove-customBuilds branch 2 times, most recently from 75f4dce to 2f6bcd3 Compare March 18, 2022 18:45
@Pacman99
Copy link
Member Author

Pacman99 commented Mar 18, 2022

The extendModules error is likely from your host being evaluated with an older version of the module system, so you would have to update to 21.11 or after. If you are already updated, then I'm not really sure whats wrong.
This is the the commit that added extendModules NixOS/nixpkgs#143207, so can you check to see if you have that commit. You can also investigate in nix repl, to see if extendModules is in your config.
I'll wait until we can resolve your issue before merging this, I want to make sure nixos-generate is actually a viable solution.

I was able to build an iso with my host, and it seems like it includes my entire hosts closure in the iso. I think the install-iso format feasibly replaces our bootstrapIso with everything but the networking part. If that was to be upstreamed to nixos-generators, then we could remove bootstrapIso.
I did have to change two definitions:
boot.grub.loader.enable = mkDefault true; networking.networkmanager.enable = !config.networking.wireless;

@danielphan2003
Copy link

I can only find Flake.outputs.nixosConfigurations.<host>._module.args.extendModules, but not top-level extendModules. I forked https://github.com/danielphan2003/nixos-generators/blob/module-args-extendModules/nixos-generate.nix to use _module.args.extendModules instead, and it seems to work. I think this is a hack, so any idea why this happens?

2022-03-19_13-03-56

@danielphan2003
Copy link

Also remove https://github.com/Pacman99/digga/blob/2f6bcd38f148a8ffc367400de532f070a0a74294/flake.nix#L51 since we're not depending on nixos-generators for customBuilds.

@blaggacao
Copy link
Contributor

bors try

bors bot added a commit that referenced this pull request Mar 23, 2022
@bors
Copy link
Contributor

bors bot commented Mar 23, 2022

try

Build failed:

@Pacman99 Pacman99 force-pushed the remove-customBuilds branch from 2f6bcd3 to 4540e9a Compare March 24, 2022 17:28
@blaggacao
Copy link
Contributor

bors try

bors bot added a commit that referenced this pull request Mar 26, 2022
@bors
Copy link
Contributor

bors bot commented Mar 26, 2022

try

Build failed:

@montchr
Copy link
Collaborator

montchr commented Mar 27, 2022

#443

@blaggacao
Copy link
Contributor

bors try

bors bot added a commit that referenced this pull request Mar 28, 2022
@bors
Copy link
Contributor

bors bot commented Mar 28, 2022

try

Build failed:

@blaggacao
Copy link
Contributor

bors try

bors bot added a commit that referenced this pull request Mar 28, 2022
@bors
Copy link
Contributor

bors bot commented Mar 28, 2022

try

Build failed:

@Pacman99 Pacman99 force-pushed the remove-customBuilds branch 2 times, most recently from 170dbe4 to b1fade4 Compare March 31, 2022 17:05
@Pacman99
Copy link
Member Author

Pacman99 commented Apr 1, 2022

This should be ready to merge with NixOS/nixpkgs#166148 in which should fix @danielphan2003's error

Users will need to update their own nixpkgs input for the feature.

@Pacman99 Pacman99 force-pushed the remove-customBuilds branch from b1fade4 to 6ee221b Compare April 1, 2022 22:52
@Pacman99 Pacman99 force-pushed the remove-customBuilds branch from 6ee221b to 51d8ca3 Compare April 1, 2022 22:53
@Pacman99 Pacman99 merged commit 6740420 into divnix:main Apr 1, 2022
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.

4 participants