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

Package request: nixos-generate-config #54174

Closed
ivan opened this issue Jan 17, 2019 · 3 comments
Closed

Package request: nixos-generate-config #54174

ivan opened this issue Jan 17, 2019 · 3 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@ivan
Copy link
Member

ivan commented Jan 17, 2019

I would like to run nixos-generate-config outside the installer environment on non-NixOS distributions, to get the hardware configuration, particularly the list of kernel modules that should go into boot.initrd.availableKernelModules. (I am installing these machines with something similar to nixos-infect rather than nixos-install.)

nixos-generate-config is currently generated only in a module.

The workaround I'm using on Debian because I can't nix-env -iA it:

apt-get install file-slurp
perl /nix/store/h3j6xqbzxl6wasxm0s61n5q3683ypfkp-nixpkgs-19.03pre166583.872502aa56b/nixpkgs/nixos/modules/installer/tools/nixos-generate-config.pl --show-hardware-config

update: now

apt-get install libfile-slurp-perl git
git clone --depth=1 https://github.com/NixOS/nixpkgs
perl nixpkgs/nixos/modules/installer/tools/nixos-generate-config.pl --show-hardware-config
@jtojnar
Copy link
Contributor

jtojnar commented Jan 17, 2019

This was previously done in #48122 but it was reverted.

As a hack, you can create the following nixos-tools.nix:

{ pkgs ? import <nixpkgs> {} }:
let
  config.nix.package = pkgs.nix;
  config.system.nixos = {
    release = "Koi";
    version = "19.03";
    codeName = "Koi";
    revision = "foo";
  };

  inherit (pkgs) lib;

  tools = import <nixpkgs/nixos/modules/installer/tools/tools.nix> { inherit pkgs lib config; };

in tools.config.system.build

and then run nix-env -f nixos-tools.nix -iA nixos-generate-config.

@stale
Copy link

stale bot commented Jun 2, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 2, 2020
@roberth
Copy link
Member

roberth commented Dec 26, 2022

Done in the form of nixos-install-tools.

@roberth roberth closed this as completed Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

No branches or pull requests

3 participants