nixos-generate-config: Add nixpkgs.system to hardware-config.nix

This commit is contained in:
Robert Hensing 2022-06-14 20:12:45 +02:00
parent e2c261f2c0
commit a234fb2a5b

View File

@ -84,6 +84,15 @@ sub debug {
}
# nixpkgs.system
my ($status, @systemLines) = runCommand("nix-instantiate --impure --eval --expr builtins.currentSystem");
if ($status != 0 || join("", @systemLines) =~ /error/) {
die "Failed to retrieve current system type from nix.\n";
}
my $system = substr(@systemLines[0], 0, -1);
push @attrs, "nixpkgs.system = lib.mkDefault $system;";
my $cpuinfo = read_file "/proc/cpuinfo";