]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
flake.nix: add netboot-bcachefs nixosSystem definition
authorKayla Firestack <dev@kaylafire.me>
Tue, 19 Oct 2021 19:28:13 +0000 (15:28 -0400)
committerKayla Firestack <dev@kaylafire.me>
Wed, 20 Oct 2021 18:47:28 +0000 (14:47 -0400)
define example bcachefs enabled nixos installer
allows netboot to nixos installer with bcachefs kernel and -tools installed

Signed-off-by: Kayla Firestack <dev@kaylafire.me>
flake.nix

index 4c73fd1414c049c6d2317f4366efb5e79b31c264..35015fb71d046c3fece74b56ebcf397ad359a177 100644 (file)
--- a/flake.nix
+++ b/flake.nix
                                boot.initrd.supportedFilesystems = [ "bcachefs" ];
                                boot.supportedFilesystems = [ "bcachefs" ];
                        });
+
+                       nixosConfigurations.netboot-bcachefs = self.systems.netboot-bcachefs "x86_64-linux";
+                       systems.netboot-bcachefs = system: (nixpkgs.lib.nixosSystem { 
+                                       inherit system; modules = [
+                                               self.nixosModule 
+                                               self.nixosModules.bcachefs-enable-boot
+                                               ("${nixpkgs}/nixos/modules/installer/netboot/netboot-minimal.nix")
+                                               ({ lib, pkgs, config, ... }: {
+                                                       # installation disk autologin
+                                                       services.getty.autologinUser = lib.mkForce "root";
+                                                       users.users.root.initialPassword = "toor";
+                                                       
+                                                       # Symlink everything together
+                                                       system.build.netboot = pkgs.symlinkJoin {
+                                                               name = "netboot";
+                                                               paths = with config.system.build; [
+                                                                       netbootRamdisk
+                                                                       kernel
+                                                                       netbootIpxeScript
+                                                               ];
+                                                               preferLocalBuild = true;
+                                                       };
+                                               })
+                                       ]; 
+                               });
                }
                // utils.lib.eachSystem supportedSystems (system: 
                let pkgs = import nixpkgs {