mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 17:33:09 +00:00
nixos-generate-config: Add nixpkgs.system to hardware-config.nix
This commit is contained in:
parent
e2c261f2c0
commit
a234fb2a5b
@ -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";
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user