Skip to content

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

Merged
Pacman99 merged 1 commit into
divnix:mainfrom
Pacman99:remove-customBuilds
Apr 1, 2022
Merged

Remove customBuilds, nixos-generate has --flake#436
Pacman99 merged 1 commit into
divnix:mainfrom
Pacman99:remove-customBuilds

Conversation

@Pacman99

@Pacman99 Pacman99 commented Feb 26, 2022

Copy link
Copy Markdown
Member

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
@astratagem

Copy link
Copy Markdown
Collaborator

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

@astratagem astratagem left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🏗️

@danielphan2003

Copy link
Copy Markdown

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

Pacman99 commented Mar 18, 2022

Copy link
Copy Markdown
Member Author

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown
Contributor

bors try

bors Bot added a commit that referenced this pull request Mar 23, 2022
@bors

bors Bot commented Mar 23, 2022

Copy link
Copy Markdown
Contributor

try

Build failed:

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

Copy link
Copy Markdown
Contributor

bors try

bors Bot added a commit that referenced this pull request Mar 26, 2022
@bors

bors Bot commented Mar 26, 2022

Copy link
Copy Markdown
Contributor

try

Build failed:

@astratagem

Copy link
Copy Markdown
Collaborator

#443

@blaggacao

Copy link
Copy Markdown
Contributor

bors try

bors Bot added a commit that referenced this pull request Mar 28, 2022
@bors

bors Bot commented Mar 28, 2022

Copy link
Copy Markdown
Contributor

try

Build failed:

Comment thread examples/devos/shell/devos.nix Outdated
@blaggacao

Copy link
Copy Markdown
Contributor

bors try

bors Bot added a commit that referenced this pull request Mar 28, 2022
@bors

bors Bot commented Mar 28, 2022

Copy link
Copy Markdown
Contributor

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

Pacman99 commented Apr 1, 2022

Copy link
Copy Markdown
Member Author

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