mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-01 09:44:18 +00:00
Merge pull request #228133 from name-snrl/fix-nix-in-nixos-generate-config
Use `hostPlatform.system` in `nixos-generate-config`
This commit is contained in:
commit
87676d039c
@ -85,12 +85,7 @@ sub debug {
|
||||
|
||||
|
||||
# nixpkgs.system
|
||||
my ($status, @systemLines) = runCommand("@nixInstantiate@ --impure --eval --expr builtins.currentSystem");
|
||||
if ($status != 0 || join("", @systemLines) =~ /error/) {
|
||||
die "Failed to retrieve current system type from nix.\n";
|
||||
}
|
||||
chomp(my $system = @systemLines[0]);
|
||||
push @attrs, "nixpkgs.hostPlatform = lib.mkDefault $system;";
|
||||
push @attrs, "nixpkgs.hostPlatform = lib.mkDefault \"@system@\";";
|
||||
|
||||
|
||||
my $cpuinfo = read_file "/proc/cpuinfo";
|
||||
|
@ -34,7 +34,7 @@ let
|
||||
name = "nixos-generate-config";
|
||||
src = ./nixos-generate-config.pl;
|
||||
perl = "${pkgs.perl.withPackages (p: [ p.FileSlurp ])}/bin/perl";
|
||||
nixInstantiate = "${pkgs.nix}/bin/nix-instantiate";
|
||||
system = pkgs.stdenv.hostPlatform.system;
|
||||
detectvirt = "${config.systemd.package}/bin/systemd-detect-virt";
|
||||
btrfs = "${pkgs.btrfs-progs}/bin/btrfs";
|
||||
inherit (config.system.nixos-generate-config) configuration desktopConfiguration;
|
||||
|
Loading…
Reference in New Issue
Block a user