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

convert bootstrap iso to a nixos-generator format #455

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Pacman99
Copy link
Member

@Pacman99 Pacman99 commented Apr 22, 2022

fixes #450

I'm not sure if this should then be exported under nixosModules, and also I'm not sure how this will integrate with nix-community/nixos-generators#148.

And this is currently untested.

@Pacman99 Pacman99 force-pushed the fix-bootstrap-iso branch 3 times, most recently from c2b992e to c81856f Compare April 22, 2022 05:27
@tomeon
Copy link
Contributor

tomeon commented Apr 22, 2022

Possibly relevant: took a crack in my digga fork at adding a devshell module for nixos-generators that includes making the bootstrap-iso format available as a --format option.

@montchr montchr added this to the Release v0.12.0 milestone Jul 9, 2022
@montchr
Copy link
Collaborator

montchr commented Jul 12, 2022

I'm not sure if this should then be exported under nixosModules

Why not?

IIRC, this was originally exposed to bud only, wasn't it? So without bud, nixosModules seems like the best option.

And this is currently untested.

I'm hoping to test it soon -- I have a remote server to re-provision coming up when I get some downtime.

@teutat3s
Copy link
Contributor

After testing this change in our fork, trying to fix iso builds, we noticed that all hosts seem to build iso configurations after this commit:
https://git.b12f.io/pub-solar/os/commit/242de215d6801d6858fe935d2ef1170651909d49
The commit just switches digga's input url to a branch in our fork of digga which already includes this PR.

I don't understand yet how the changes in this PR could affect all hosts and not just

nix build '.#nixosConfigurations.bootstrap.config.system.build.isoImage'

@montchr
Copy link
Collaborator

montchr commented Aug 30, 2022

@teutat3s I ran into a similar moment of confusion in my own configs -- however, I have not been tracking this branch. The fix, in my case, was removing the ISO module from nixos.hostDefaults.modules:

https://github.com/montchr/dotfield/blob/e1b09712fef297ee6173f7010787cd5b2b574a17/nixos/default.nix#L85-L88

Based on this line in your source repo, it looks like you also have it included in nixos.hostDefaults.modules, but that doesn't explain why changing the source of the digga input caused the rebuilds in your case... did you have the module included in nixos.hostDefaults.modules before changing the input source?

@teutat3s
Copy link
Contributor

@montchr thank you for the feedback. Yeah the module was included before, we sticked with DevOS defaults of nixos.hostDefaults.modules until now. I'll try if commenting that line fixes our issue, too.

@teutat3s
Copy link
Contributor

After testing this for a while in our CI, I'd like to confirm this works fine.

What else is needed to move this forward?

We needed the following two changes in our flake.nix, to fix the mentioned issue we saw and use the module correctly:

https://git.b12f.io/pub-solar/os/commit/b7ba1b7ba9b87c7a60e3f2fe4772d8579b0ed711

diff --git a/flake.nix b/flake.nix
index 466d1077..41cd4ff2 100644
--- a/flake.nix
+++ b/flake.nix
@@ -92,7 +92,10 @@
             imports = [ (digga.lib.importExportableModules ./modules) ];
             modules = [
               { lib.our = self.lib; }
-              digga.nixosModules.bootstrapIso
+              # FIXME: upstream module causes a huge number of unnecessary
+              # dependencies to be pulled in for all systems -- many of them are
+              # graphical. should only be imported as needed.
+              # digga.nixosModules.bootstrapIso
               digga.nixosModules.nixConfig
               home.nixosModules.home-manager
               agenix.nixosModules.age

https://git.b12f.io/pub-solar/os/commit/0fbabc23b921fa8ac8ac5647d1ff6b5a360b70c4

diff --git a/flake.nix b/flake.nix
index 41cd4ff2..4ac60e8a 100644
--- a/flake.nix
+++ b/flake.nix
@@ -105,6 +105,11 @@
           imports = [ (digga.lib.importHosts ./hosts) ];
           hosts = {
             /* set host specific properties here */
+            bootstrap = {
+              modules = [
+                digga.nixosModules.bootstrapIso
+              ];
+            };
             PubSolarOS = {
               tests = [
                 (import ./tests/first-test.nix { pkgs = nixos.legacyPackages.x86_64-linux; lib = nixos.lib; })

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.

nixosModules.bootstrapIso no longer usable
4 participants