about summary refs log tree commit diff
path: root/nixos/modules/installer
diff options
context:
space:
mode:
authorname_snrl <Demogorgon-74@ya.ru>2023-04-26 23:51:48 +0500
committername_snrl <Demogorgon-74@ya.ru>2023-04-26 23:51:48 +0500
commit1aa8534f3e3efebd54cba98c65b8724aeed9427e (patch)
tree4be35769838a8c93d0b54e37d2988b115f896d7e /nixos/modules/installer
parent136f6ccdc8c2be7cc7f0f9a665fbe479ff50866e (diff)
downloadnixlib-1aa8534f3e3efebd54cba98c65b8724aeed9427e.tar
nixlib-1aa8534f3e3efebd54cba98c65b8724aeed9427e.tar.gz
nixlib-1aa8534f3e3efebd54cba98c65b8724aeed9427e.tar.bz2
nixlib-1aa8534f3e3efebd54cba98c65b8724aeed9427e.tar.lz
nixlib-1aa8534f3e3efebd54cba98c65b8724aeed9427e.tar.xz
nixlib-1aa8534f3e3efebd54cba98c65b8724aeed9427e.tar.zst
nixlib-1aa8534f3e3efebd54cba98c65b8724aeed9427e.zip
nixos/nixos-generate-config: use `hostPlatform.system` instead of calling `nix`
Diffstat (limited to 'nixos/modules/installer')
-rw-r--r--nixos/modules/installer/tools/nixos-generate-config.pl7
-rw-r--r--nixos/modules/installer/tools/tools.nix2
2 files changed, 2 insertions, 7 deletions
diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl
index a082ed3450e9..c65898b261cb 100644
--- a/nixos/modules/installer/tools/nixos-generate-config.pl
+++ b/nixos/modules/installer/tools/nixos-generate-config.pl
@@ -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";
diff --git a/nixos/modules/installer/tools/tools.nix b/nixos/modules/installer/tools/tools.nix
index 08278d3943f3..902a9e7367e7 100644
--- a/nixos/modules/installer/tools/tools.nix
+++ b/nixos/modules/installer/tools/tools.nix
@@ -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;