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

Closed
wants to merge 1 commit into from
Closed

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 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 {
Copy link
Member

Choose a reason for hiding this comment

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

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;
  };

Copy link
Member

Choose a reason for hiding this comment

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

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
Member

teto commented May 11, 2020

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

@Mic92
Copy link
Member

Mic92 commented May 14, 2020

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

@Mic92
Copy link
Member

Mic92 commented May 14, 2020

This pr has a merge conflict now.

@bbigras
Copy link
Contributor Author

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";
Copy link
Member

Choose a reason for hiding this comment

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

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

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

Choose a reason for hiding this comment

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

This might be better in documentation.

@stale
Copy link

stale bot commented Nov 14, 2020

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 14, 2020
@bbigras
Copy link
Contributor Author

bbigras commented Nov 14, 2020

I'll try to find time for this soon.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 14, 2020
@bbigras bbigras closed this Mar 31, 2021
@bbigras bbigras deleted the pxe branch March 31, 2021 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants