nixos-generate-config: Make robust against missing newline
The substr solution assumed a newline to be present. The new solution will not remove the newline if it goes missing in the future. Apparently this is idiomatic perl. Thanks pennae for the suggestion!
This commit is contained in:
parent
1b4f4ddb5b
commit
82da0794c2
1 changed files with 1 additions and 1 deletions
|
@ -89,7 +89,7 @@ my ($status, @systemLines) = runCommand("nix-instantiate --impure --eval --expr
|
|||
if ($status != 0 || join("", @systemLines) =~ /error/) {
|
||||
die "Failed to retrieve current system type from nix.\n";
|
||||
}
|
||||
my $system = substr(@systemLines[0], 0, -1);
|
||||
chomp(my $system = @systemLines[0]);
|
||||
push @attrs, "nixpkgs.hostPlatform = lib.mkDefault $system;";
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue