Merge pull request #85620 from matthewbauer/use-modulesPath-for-nixos-generate-config

nixos/nixos-generate-config.pl: use modulesPath instead of <nixpkgs>
This commit is contained in:
Eelco Dolstra 2020-04-20 17:25:17 +02:00 committed by GitHub
commit f76d7b5e41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -180,7 +180,7 @@ sub pciCheck {
) )
{
# we need e.g. brcmfmac43602-pcie.bin
push @imports, "<nixpkgs/nixos/modules/hardware/network/broadcom-43xx.nix>";
push @imports, "(modulesPath + \"/hardware/network/broadcom-43xx.nix\")";
}
# Can't rely on $module here, since the module may not be loaded
@ -279,7 +279,7 @@ if ($virt eq "oracle") {
# Likewise for QEMU.
if ($virt eq "qemu" || $virt eq "kvm" || $virt eq "bochs") {
push @imports, "<nixpkgs/nixos/modules/profiles/qemu-guest.nix>";
push @imports, "(modulesPath + \"/profiles/qemu-guest.nix\")";
}
# Also for Hyper-V.
@ -296,7 +296,7 @@ if ($virt eq "systemd-nspawn") {
# Provide firmware for devices that are not detected by this script,
# unless we're in a VM/container.
push @imports, "<nixpkgs/nixos/modules/installer/scan/not-detected.nix>"
push @imports, "(modulesPath + \"/installer/scan/not-detected.nix\")"
if $virt eq "none";
@ -549,7 +549,7 @@ my $hwConfig = <<EOF;
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }:
{ config, lib, pkgs, modulesPath, ... }:
{
imports =${\multiLineList(" ", @imports)};