avoid using NIX_PATH in resulting hardware-configuration.nix (#65)

This makes the resulting hardware-configuration.nix usable from a system
that is a nix flake without having to replace that usage of NIX_PATH first.
This commit is contained in:
mschwaig 2021-01-01 07:50:30 +01:00 committed by GitHub
parent dfc6f222da
commit bdfc7b6a8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,9 +38,9 @@ makeConf() {
EOF EOF
# If you rerun this later, be sure to prune the filesSystems attr # If you rerun this later, be sure to prune the filesSystems attr
cat > /etc/nixos/hardware-configuration.nix << EOF cat > /etc/nixos/hardware-configuration.nix << EOF
{ ... }: { modulesPath, ... }:
{ {
imports = [ <nixpkgs/nixos/modules/profiles/qemu-guest.nix> ]; imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.loader.grub.device = "$grubdev"; boot.loader.grub.device = "$grubdev";
fileSystems."/" = { device = "$rootfsdev"; fsType = "ext4"; }; fileSystems."/" = { device = "$rootfsdev"; fsType = "ext4"; };
} }