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

nixos/pxe: init (WIP, do not merge) #83443

Draft
wants to merge 1 commit into
base: master
from
Draft

nixos/pxe: init (WIP, do not merge) #83443

wants to merge 1 commit into from

Conversation

@bbigras
Copy link
Contributor

@bbigras bbigras commented Mar 26, 2020

Ignore the first commit. It's from another PR not yet merged.

Can someone tell me why I can call nix-build -E 'with import <nixpkgs> {}; callPackage ./netboot.nix {}'fine but if I try to build the module with nixos-rebuild build I get:

$ sudo nixos-rebuild switch -I nixpkgs=~/nixpkgs
building Nix...
building the system configuration...
error: file '/home/bbigras/nixpkgs/nixos/tests/vde1.ctl/.05386-00000' has an unsupported type
(use '--show-trace' to show detailed location information)
@flokli
Copy link
Contributor

@flokli flokli commented Mar 29, 2020

@bbigras your error smells like it should be fixed by #83598 - you had a stray vde*.ctl in your nixpkgs checkout.

# system = ...;
};
in
pkgs.symlinkJoin {

This comment has been minimized.

@Mic92

Mic92 Mar 29, 2020
Contributor

I don't think we need the symlinkJoin here:
This is what I am using:

  services.pixiecore = let
    nixos = import <nixpkgs/nixos> {
      configuration = { config, pkgs, lib, ... }: with lib; {
        imports = [
          <nixpkgs/nixos/modules/installer/netboot/netboot-minimal.nix>
        ];
        # Some useful options for setting up a new system
        services.mingetty.autologinUser = mkForce "root";
        # Enable sshd which gets disabled by netboot-minimal.nix
        systemd.services.sshd.wantedBy = mkOverride 0 [ "multi-user.target" ];
        # users.users.root.openssh.authorizedKeys.keys = [ ... ];
        # i18n.consoleKeyMap = "de";
      };
    };
    build = nixos.config.system.build;
  in {
    enable = true;
    openFirewall = true;
    mode = "boot";
    kernel = "${build.kernel}/bzImage";
    initrd = "${toString build.netbootRamdisk}/initrd";
    cmdLine = "init=${build.netbootIpxeScript} ${lib.concatStringsSep " " nixos.config.boot.kernelParams} debug";
    dhcpNoBind = true;
  };

This comment has been minimized.

@Mic92

Mic92 Mar 29, 2020
Contributor

Also people want likely pass there own NixOS configuration to the netboot instance as well. You can have a look at containers.<name>.config in nixpkgs/nixos/modules/virtualisation/containers.nix

@teto
Copy link
Contributor

@teto teto commented May 11, 2020

would be interested in testing but there are several issues on nixos-unstable.

@Mic92
Copy link
Contributor

@Mic92 Mic92 commented May 14, 2020

There was a bug in the pixiecore module by the way: #87664 booting should work now.

@Mic92
Copy link
Contributor

@Mic92 Mic92 commented May 14, 2020

This pr has a merge conflict now.

@bbigras bbigras force-pushed the bbigras:pxe branch from 2fd54c1 to f835615 May 15, 2020
@bbigras
Copy link
Contributor Author

@bbigras bbigras commented May 18, 2020

I did a rebase 3 days ago. I'll try to find some time to address the issues this week.

(pkgs.path + "/nixos/modules/installer/netboot/netboot-minimal.nix")
];
## Some useful options for setting up a new system
services.mingetty.autologinUser = mkForce "root";

This comment has been minimized.

@Mic92

Mic92 May 18, 2020
Contributor

This might be a reasonable default, but some users might want to disable it. Is there a way to apply it without mkForce?

# users.users.root.openssh.authorizedKeys.keys = [ ... ];
# i18n.consoleKeyMap = "de";
Comment on lines +12 to +13

This comment has been minimized.

@Mic92

Mic92 May 18, 2020
Contributor

This might be better in documentation.

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

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.